12 //#include "demuxer.h"
13 //#include "stheader.h"
14 #include "aviheader.h"
21 static muxer_stream_t
* rawvideofile_new_stream(muxer_t
*muxer
,int type
){
23 if (!muxer
) return NULL
;
24 s
=malloc(sizeof(muxer_stream_t
));
25 memset(s
,0,sizeof(muxer_stream_t
));
26 if(!s
) return NULL
; // no mem!?
27 muxer
->streams
[muxer
->avih
.dwStreams
]=s
;
29 s
->id
=muxer
->avih
.dwStreams
;
34 case MUXER_TYPE_VIDEO
:
35 s
->ckid
=mmioFOURCC(('0'+s
->id
/10),('0'+(s
->id
%10)),'d','c');
36 s
->h
.fccType
=streamtypeVIDEO
;
37 if(!muxer
->def_v
) muxer
->def_v
=s
;
40 muxer
->avih
.dwStreams
++;
44 static void write_rawvideo_chunk(FILE *f
,int len
,void* data
){
53 static void rawvideofile_write_chunk(muxer_stream_t
*s
,size_t len
,unsigned int flags
, double dts
, double pts
){
54 muxer_t
*muxer
=s
->muxer
;
56 // write out the chunk:
57 if (s
->type
== MUXER_TYPE_VIDEO
)
58 write_rawvideo_chunk(muxer
->file
,len
,s
->buffer
); /* unsigned char */
60 // if((unsigned int)len>s->h.dwSuggestedBufferSize) s->h.dwSuggestedBufferSize=len;
64 static void rawvideofile_write_header(muxer_t
*muxer
){
68 static void rawvideofile_write_index(muxer_t
*muxer
){
72 int muxer_init_muxer_rawvideo(muxer_t
*muxer
){
73 muxer
->cont_new_stream
= &rawvideofile_new_stream
;
74 muxer
->cont_write_chunk
= &rawvideofile_write_chunk
;
75 muxer
->cont_write_header
= &rawvideofile_write_header
;
76 muxer
->cont_write_index
= &rawvideofile_write_index
;