comparison dv.c @ 3777:20545fbb6f7c libavcodec

add some #ifdef CONFIG_ENCODERS/DECODERS
author mru
date Wed, 27 Sep 2006 19:54:07 +0000
parents 18113845d891
children e1986d9ddc2d
comparison
equal deleted inserted replaced
3776:1843a85123b7 3777:20545fbb6f7c
1008 dv_decode_video_segment(s, &s->buf[((chan_slice/27)*6+(chan_slice/3)+chan_slice*5+7)*80 + chan_offset], 1008 dv_decode_video_segment(s, &s->buf[((chan_slice/27)*6+(chan_slice/3)+chan_slice*5+7)*80 + chan_offset],
1009 &s->sys->video_place[slice*5]); 1009 &s->sys->video_place[slice*5]);
1010 return 0; 1010 return 0;
1011 } 1011 }
1012 1012
1013 #ifdef CONFIG_ENCODERS
1013 static int dv_encode_mt(AVCodecContext *avctx, void* sl) 1014 static int dv_encode_mt(AVCodecContext *avctx, void* sl)
1014 { 1015 {
1015 DVVideoContext *s = avctx->priv_data; 1016 DVVideoContext *s = avctx->priv_data;
1016 int slice = (size_t)sl; 1017 int slice = (size_t)sl;
1017 1018
1026 1027
1027 dv_encode_video_segment(s, &s->buf[((chan_slice/27)*6+(chan_slice/3)+chan_slice*5+7)*80 + chan_offset], 1028 dv_encode_video_segment(s, &s->buf[((chan_slice/27)*6+(chan_slice/3)+chan_slice*5+7)*80 + chan_offset],
1028 &s->sys->video_place[slice*5]); 1029 &s->sys->video_place[slice*5]);
1029 return 0; 1030 return 0;
1030 } 1031 }
1031 1032 #endif
1033
1034 #ifdef CONFIG_DECODERS
1032 /* NOTE: exactly one frame must be given (120000 bytes for NTSC, 1035 /* NOTE: exactly one frame must be given (120000 bytes for NTSC,
1033 144000 bytes for PAL - or twice those for 50Mbps) */ 1036 144000 bytes for PAL - or twice those for 50Mbps) */
1034 static int dvvideo_decode_frame(AVCodecContext *avctx, 1037 static int dvvideo_decode_frame(AVCodecContext *avctx,
1035 void *data, int *data_size, 1038 void *data, int *data_size,
1036 uint8_t *buf, int buf_size) 1039 uint8_t *buf, int buf_size)
1066 *data_size = sizeof(AVFrame); 1069 *data_size = sizeof(AVFrame);
1067 *(AVFrame*)data= s->picture; 1070 *(AVFrame*)data= s->picture;
1068 1071
1069 return s->sys->frame_size; 1072 return s->sys->frame_size;
1070 } 1073 }
1074 #endif
1071 1075
1072 1076
1073 static inline int dv_write_pack(enum dv_pack_type pack_id, DVVideoContext *c, uint8_t* buf) 1077 static inline int dv_write_pack(enum dv_pack_type pack_id, DVVideoContext *c, uint8_t* buf)
1074 { 1078 {
1075 /* 1079 /*
1240 CODEC_CAP_DR1, 1244 CODEC_CAP_DR1,
1241 NULL 1245 NULL
1242 }; 1246 };
1243 #endif // CONFIG_DVVIDEO_ENCODER 1247 #endif // CONFIG_DVVIDEO_ENCODER
1244 1248
1249 #ifdef CONFIG_DVVIDEO_DECODER
1245 AVCodec dvvideo_decoder = { 1250 AVCodec dvvideo_decoder = {
1246 "dvvideo", 1251 "dvvideo",
1247 CODEC_TYPE_VIDEO, 1252 CODEC_TYPE_VIDEO,
1248 CODEC_ID_DVVIDEO, 1253 CODEC_ID_DVVIDEO,
1249 sizeof(DVVideoContext), 1254 sizeof(DVVideoContext),
1252 dvvideo_close, 1257 dvvideo_close,
1253 dvvideo_decode_frame, 1258 dvvideo_decode_frame,
1254 CODEC_CAP_DR1, 1259 CODEC_CAP_DR1,
1255 NULL 1260 NULL
1256 }; 1261 };
1262 #endif