diff options
| author | Tim Redfern <tim@eclectronics.org> | 2013-12-29 12:19:38 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2013-12-29 12:19:38 +0000 |
| commit | f7813a5324be39d13ab536c245d15dfc602a7849 (patch) | |
| tree | fad99148b88823d34a5df2f0a25881a002eb291b /ffmpeg/libavcodec/flashsv2enc.c | |
| parent | b7a5a477b8ff4d4e3028b9dfb9a9df0a41463f92 (diff) | |
basic type mechanism working
Diffstat (limited to 'ffmpeg/libavcodec/flashsv2enc.c')
| -rw-r--r-- | ffmpeg/libavcodec/flashsv2enc.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/ffmpeg/libavcodec/flashsv2enc.c b/ffmpeg/libavcodec/flashsv2enc.c index 1d0d196..436daa4 100644 --- a/ffmpeg/libavcodec/flashsv2enc.c +++ b/ffmpeg/libavcodec/flashsv2enc.c @@ -87,7 +87,6 @@ typedef struct FlashSV2Context { AVCodecContext *avctx; uint8_t *current_frame; uint8_t *key_frame; - AVFrame frame; uint8_t *encbuffer; uint8_t *keybuffer; uint8_t *databuffer; @@ -849,15 +848,12 @@ static int reconfigure_at_keyframe(FlashSV2Context * s, const uint8_t * image, } static int flashsv2_encode_frame(AVCodecContext *avctx, AVPacket *pkt, - const AVFrame *pict, int *got_packet) + const AVFrame *p, int *got_packet) { FlashSV2Context *const s = avctx->priv_data; - AVFrame *const p = &s->frame; int res; int keyframe = 0; - *p = *pict; - if ((res = ff_alloc_packet2(avctx, pkt, s->frame_size + FF_MIN_BUFFER_SIZE)) < 0) return res; @@ -891,18 +887,11 @@ static int flashsv2_encode_frame(AVCodecContext *avctx, AVPacket *pkt, if (keyframe) { new_key_frame(s); - p->pict_type = AV_PICTURE_TYPE_I; - p->key_frame = 1; s->last_key_frame = avctx->frame_number; pkt->flags |= AV_PKT_FLAG_KEY; av_log(avctx, AV_LOG_DEBUG, "Inserting key frame at frame %d\n", avctx->frame_number); - } else { - p->pict_type = AV_PICTURE_TYPE_P; - p->key_frame = 0; } - avctx->coded_frame = p; - pkt->size = res; *got_packet = 1; @@ -920,6 +909,7 @@ static av_cold int flashsv2_encode_end(AVCodecContext * avctx) AVCodec ff_flashsv2_encoder = { .name = "flashsv2", + .long_name = NULL_IF_CONFIG_SMALL("Flash Screen Video Version 2"), .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_FLASHSV2, .priv_data_size = sizeof(FlashSV2Context), @@ -927,5 +917,4 @@ AVCodec ff_flashsv2_encoder = { .encode2 = flashsv2_encode_frame, .close = flashsv2_encode_end, .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE }, - .long_name = NULL_IF_CONFIG_SMALL("Flash Screen Video Version 2"), }; |
