summaryrefslogtreecommitdiff
path: root/src/Demuxer.h
blob: 5c90ddaa8369a63c1e4db0c2b51cc00fca78cfd9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
 * Demux.h
 *
 *  Created on: 2014. 6. 11.
 *      Author: oskwon
 */

#ifndef DEMUX_H_
#define DEMUX_H_

#include <vector>
#include <string>

#include "trap.h"

#include "Util.h"
#include "Http.h"
#include "Source.h"
//----------------------------------------------------------------------

class Demuxer : public Source
{
public:
	int	pmt_pid;
	int	video_pid;
	int	audio_pid;

private:
	int fd;
	int sock;

	int demux_id;
	int pat_pid;
	std::vector<unsigned long> pids;

protected:
	std::string webif_reauest(std::string request) throw(http_trap);
	bool already_exist(std::vector<unsigned long> &pidlist, int pid);
	void set_filter(std::vector<unsigned long> &new_pids) throw(trap);
	bool parse_webif_response(std::string& response, std::vector<unsigned long> &new_pids);

public:
	Demuxer(HttpHeader *header) throw(http_trap);
	virtual ~Demuxer() throw();
	int get_fd() const throw();
};
//----------------------------------------------------------------------

#endif /* DEMUX_H_ */