9 //#include "stream/stream.h"
10 //#include "demuxer.h"
11 //#include "stheader.h"
12 #include "aviheader.h"
15 #include "stream/stream.h"
18 static muxer_stream_t
* rawvideofile_new_stream(muxer_t
*muxer
,int type
){
20 if (!muxer
) return NULL
;
21 s
=malloc(sizeof(muxer_stream_t
));
22 memset(s
,0,sizeof(muxer_stream_t
));
23 if(!s
) return NULL
; // no mem!?
24 muxer
->streams
[muxer
->avih
.dwStreams
]=s
;
26 s
->id
=muxer
->avih
.dwStreams
;
31 case MUXER_TYPE_VIDEO
:
32 s
->ckid
=mmioFOURCC(('0'+s
->id
/10),('0'+(s
->id
%10)),'d','c');
33 s
->h
.fccType
=streamtypeVIDEO
;
34 if(!muxer
->def_v
) muxer
->def_v
=s
;
37 muxer
->avih
.dwStreams
++;
41 static void write_rawvideo_chunk(stream_t
*stream
,int len
,void* data
){
45 stream_write_buffer(stream
,data
,len
);
50 static void rawvideofile_write_chunk(muxer_stream_t
*s
,size_t len
,unsigned int flags
, double dts
, double pts
){
51 muxer_t
*muxer
=s
->muxer
;
53 // write out the chunk:
54 if (s
->type
== MUXER_TYPE_VIDEO
)
55 write_rawvideo_chunk(muxer
->stream
,len
,s
->buffer
); /* unsigned char */
57 // if((unsigned int)len>s->h.dwSuggestedBufferSize) s->h.dwSuggestedBufferSize=len;
61 static void rawvideofile_write_header(muxer_t
*muxer
){
65 static void rawvideofile_write_index(muxer_t
*muxer
){
69 int muxer_init_muxer_rawvideo(muxer_t
*muxer
){
70 muxer
->cont_new_stream
= &rawvideofile_new_stream
;
71 muxer
->cont_write_chunk
= &rawvideofile_write_chunk
;
72 muxer
->cont_write_header
= &rawvideofile_write_header
;
73 muxer
->cont_write_index
= &rawvideofile_write_index
;