openATV enigma2
openATV is an open source SetTopBox Graphical user interface.
servicemp3record.h
Go to the documentation of this file.
1 #ifndef __servicemp3record_h
2 #define __servicemp3record_h
3 
4 #include <lib/service/iservice.h>
6 #include <lib/dvb/idvb.h>
7 #include <gst/gst.h>
8 
10  public iRecordableService,
11  public sigc::trackable
12 {
13  DECLARE_REF(eServiceMP3Record);
14 public:
15  RESULT connectEvent(const sigc::slot2<void,iRecordableService*,int> &event, ePtr<eConnection> &connection);
16  RESULT prepare(const char *filename, time_t begTime, time_t endTime, int eit_event_id, const char *name, const char *descr, const char *tags, bool descramble, bool recordecm, int packetsize);
17  RESULT prepareStreaming(bool descramble, bool includeecm);
18  RESULT start(bool simulate=false);
19  RESULT stop();
21  RESULT getError(int &error) { error = m_error; return 0; };
24  RESULT getFilenameExtension(std::string &ext) { ext = ".stream"; return 0; };
25 
26 private:
27  enum { stateIdle, statePrepared, stateRecording };
28  GstElement* m_recording_pipeline;
29  GstElement* m_source;
30  bool m_simulate;
31  int m_state;
32  int m_error;
33  std::string m_filename;
34  eServiceReference m_ref;
35  ePtr<eConnection> m_con_record_event;
36  ePtr<eTimer> m_streamingsrc_timeout;
37  std::string m_useragent;
38  std::string m_extra_headers;
40 
41  friend class eServiceFactoryMP3;
44 
45  int doRecord();
46  int doPrepare();
47  void gstPoll(ePtr<GstMessageContainer> const &);
48  void sourceTimeout();
49  void gstBusCall(GstMessage *msg);
50  void handleMessage(GstMessage *msg);
51  static GstBusSyncReply gstBusSyncHandler(GstBus *bus, GstMessage *message, gpointer user_data);
52  static void handleUridecNotifySource(GObject *object, GParamSpec *unused, gpointer user_data);
53  static void handlePadAdded(GstElement *element, GstPad *pad, gpointer user_data);
54  static gboolean handleAutoPlugCont(GstElement *bin, GstPad *pad, GstCaps *caps, gpointer user_data);
55 
56  /* events */
57  sigc::signal2<void,iRecordableService*,int> m_event;
58 };
59 
60 #endif
static int ptr
Definition: bcm.cpp:17
A messagepump with fixed-length packets.
Definition: message.h:42
Definition: servicemp3.h:16
Definition: servicemp3record.h:12
RESULT frontendInfo(ePtr< iFrontendInformation > &ptr)
Definition: servicemp3record.cpp:491
RESULT getError(int &error)
Definition: servicemp3record.h:21
RESULT stop()
Definition: servicemp3record.cpp:108
RESULT stream(ePtr< iStreamableService > &ptr)
Definition: servicemp3record.cpp:503
RESULT getFilenameExtension(std::string &ext)
Definition: servicemp3record.h:24
RESULT prepare(const char *filename, time_t begTime, time_t endTime, int eit_event_id, const char *name, const char *descr, const char *tags, bool descramble, bool recordecm, int packetsize)
Definition: servicemp3record.cpp:55
RESULT prepareStreaming(bool descramble, bool includeecm)
Definition: servicemp3record.cpp:94
RESULT subServices(ePtr< iSubserviceList > &ptr)
Definition: servicemp3record.cpp:509
RESULT connectEvent(const sigc::slot2< void, iRecordableService *, int > &event, ePtr< eConnection > &connection)
Definition: servicemp3record.cpp:497
RESULT start(bool simulate=false)
Definition: servicemp3record.cpp:99
Definition: iservice.h:15
Definition: iservice.h:1049
const char * filename
Definition: epng.h:36
name
Definition: newplugin.py:9
list ref
Definition: create_picon_e1_to_e2.py:17
int RESULT
Definition: object.h:12
struct _GstElement GstElement
Definition: servicemp3.h:118