11 //#include "stream/stream.h"
12 //#include "demuxer.h"
13 //#include "stheader.h"
14 #include "aviheader.h"
17 #include "stream/stream.h"
20 static muxer_stream_t
* rawvideofile_new_stream(muxer_t
*muxer
,int type
){
22 if (!muxer
) return NULL
;
23 s
=malloc(sizeof(muxer_stream_t
));
24 memset(s
,0,sizeof(muxer_stream_t
));
25 if(!s
) return NULL
; // no mem!?
26 muxer
->streams
[muxer
->avih
.dwStreams
]=s
;
28 s
->id
=muxer
->avih
.dwStreams
;
33 case MUXER_TYPE_VIDEO
:
34 s
->ckid
=mmioFOURCC(('0'+s
->id
/10),('0'+(s
->id
%10)),'d','c');
35 s
->h
.fccType
=streamtypeVIDEO
;
36 if(!muxer
->def_v
) muxer
->def_v
=s
;
39 muxer
->avih
.dwStreams
++;
43 static void write_rawvideo_chunk(stream_t
*stream
,int len
,void* data
){
47 stream_write_buffer(stream
,data
,len
);
52 static void rawvideofile_write_chunk(muxer_stream_t
*s
,size_t len
,unsigned int flags
, double dts
, double pts
){
53 muxer_t
*muxer
=s
->muxer
;
55 // write out the chunk:
56 if (s
->type
== MUXER_TYPE_VIDEO
)
57 write_rawvideo_chunk(muxer
->stream
,len
,s
->buffer
); /* unsigned char */
59 // if((unsigned int)len>s->h.dwSuggestedBufferSize) s->h.dwSuggestedBufferSize=len;
63 static void rawvideofile_write_header(muxer_t
*muxer
){
67 static void rawvideofile_write_index(muxer_t
*muxer
){
71 int muxer_init_muxer_rawvideo(muxer_t
*muxer
){
72 muxer
->cont_new_stream
= &rawvideofile_new_stream
;
73 muxer
->cont_write_chunk
= &rawvideofile_write_chunk
;
74 muxer
->cont_write_header
= &rawvideofile_write_header
;
75 muxer
->cont_write_index
= &rawvideofile_write_index
;