1 #ifndef muxer_HEADER_GUARD
2 #define muxer_HEADER_GUARD
68 std::string format_name;
71 uint32_t missing, ccf;
74 AVFormatContext *av_format_ctx;
75 AVIOContext *avio_ctx;
76 uint8_t *avio_ctx_buffer;
78 std::vector<AVCodecContext*> codec_contexes;
79 std::vector<AVStream*> streams;
80 AVFormatContext *av_format_context;
82 AVDictionary *av_dict;
85 static const size_t avio_ctx_buffer_size = 4096;
114 static int write_packet(
void *opaque, uint8_t *buf,
int buf_size);
115 static int read_packet(
void *opaque, uint8_t *buf,
int buf_size) {
return 0;}
116 static int64_t seek(
void *opaque, int64_t offset,
int whence) {
return 0;}
127 bool got_ftyp, got_moov;
137 static int write_packet(
void *opaque, uint8_t *buf,
int buf_size_);
138 static int read_packet(
void *opaque, uint8_t *buf,
int buf_size) {
return 0;}
139 static int64_t seek(
void *opaque, int64_t offset,
int whence) {
return 0;}
152 void getLenName(uint8_t* data, uint32_t& len,
char* name);
172 bool moofHasFirstSampleFlag(uint8_t* data);
Custom payload Frame.
Definition: frame.h:166
virtual void defineMux()
Define container format (format_name) & muxing parameters (av_dict). Define in child classes.
Definition: muxer.cpp:617
static int write_packet(void *opaque, uint8_t *buf, int buf_size_)
Definition: muxer.cpp:638
The mother class of all frame filters! FrameFilters are used to create "filter chains".
Definition: framefilter.h:44
FrameFilter * next
The next frame filter in the chain to be applied.
Definition: framefilter.h:60
Frame: An abstract queueable class.
Definition: frame.h:112
void deActivate()
Stop streaming // <pyapi>
Definition: muxer.cpp:575
std::mutex mutex
Mutex protecting the "active" boolean.
Definition: muxer.h:88
std::vector< SetupFrame > setupframes
deep copies of the arrived setup frames
Definition: muxer.h:92
long int zerotime
Start time set explicitly by the user.
Definition: muxer.h:62
long int mstimestamp0
Time of activation (i.e. when the recording started)
Definition: muxer.h:61
bool initialized
After ready & active, initMux is called (set streams, codec ctx, etc.
Definition: muxer.h:60
BasicFrame extradata_frame
capture decoder extradata here
Definition: muxer.h:97
bool has_extradata
Got "extradata" (sps & pps)
Definition: muxer.h:55
virtual void run(Frame *frame)
Calls this->go(Frame* frame) and then calls the this->next->run(Frame* frame) (if this->next !...
Definition: muxer.cpp:302
virtual void defineMux()=0
Define container format (format_name) & muxing parameters (av_dict). Define in child classes.
virtual void go(Frame *frame)
Does the actual filtering/modification to the Frame. Define in subclass.
Definition: muxer.cpp:308
bool ready
Got enough setup frames & extradata.
Definition: muxer.h:57
MuxFrame internal_frame
outgoing muxed frame
Definition: muxer.h:96
void initMux()
Open file, reserve codec_contexes, streams, write preamble, set initialized=true if success.
Definition: muxer.cpp:93
std::condition_variable condition
Condition variable for the mutex.
Definition: muxer.h:89
int extradata_count
Check that we have the sps => pps sequence.
Definition: muxer.h:56
void activate(long int zerotime=0)
Request streaming to asap (when config frames have arrived) // <pyapi>
Definition: muxer.cpp:564
bool active
Writing to muxer has been requested.
Definition: muxer.h:54
void closeMux()
Close file, dealloc codec_contexes, streams.
Definition: muxer.cpp:256
A muxed packet (in some container format)
Definition: frame.h:220
Constant/default values, version numbers.
Definition of FrameFilter and derived classes for various purposes.
uint32_t getSubBoxIndex(uint8_t *data, const char name[4])
Gives index of a certain MP4 sub-box, as identified by the box type's name.
Definition: muxer.cpp:810
void getLenName(uint8_t *data, uint32_t &len, char *name)
Gives length and name of an MP4 box.
Definition: muxer.cpp:804