~ubuntu-branches/ubuntu/saucy/gst-libav1.0/saucy-proposed

« back to all changes in this revision

Viewing changes to gst-libs/ext/libav/libavcodec/mpeg4video_parser.c

  • Committer: Package Import Robot
  • Author(s): Sebastian Dröge
  • Date: 2013-07-30 09:00:15 UTC
  • mfrom: (1.1.16) (7.1.7 experimental)
  • Revision ID: package-import@ubuntu.com-20130730090015-sc1ou2yssu7q5w4e
Tags: 1.1.3-1
* New upstream development snapshot:
  + debian/control:
    - Build depend on GStreamer and gst-plugins-base >= 1.1.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include "mpeg4video.h"
26
26
#include "mpeg4video_parser.h"
27
27
 
 
28
struct Mp4vParseContext {
 
29
    ParseContext pc;
 
30
    struct MpegEncContext enc;
 
31
    int first_picture;
 
32
};
28
33
 
29
34
int ff_mpeg4_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size){
30
35
    int vop_found, i;
68
73
                                  AVCodecContext *avctx,
69
74
                                  const uint8_t *buf, int buf_size)
70
75
{
71
 
    ParseContext1 *pc = s1->priv_data;
72
 
    MpegEncContext *s = pc->enc;
 
76
    struct Mp4vParseContext *pc = s1->priv_data;
 
77
    MpegEncContext *s = &pc->enc;
73
78
    GetBitContext gb1, *gb = &gb1;
74
79
    int ret;
75
80
 
93
98
 
94
99
static av_cold int mpeg4video_parse_init(AVCodecParserContext *s)
95
100
{
96
 
    ParseContext1 *pc = s->priv_data;
 
101
    struct Mp4vParseContext *pc = s->priv_data;
97
102
 
98
 
    pc->enc = av_mallocz(sizeof(MpegEncContext));
99
 
    if (!pc->enc)
100
 
        return -1;
101
103
    pc->first_picture = 1;
102
 
    pc->enc->slice_context_count = 1;
 
104
    pc->enc.slice_context_count = 1;
103
105
    return 0;
104
106
}
105
107
 
131
133
 
132
134
 
133
135
AVCodecParser ff_mpeg4video_parser = {
134
 
    .codec_ids      = { CODEC_ID_MPEG4 },
135
 
    .priv_data_size = sizeof(ParseContext1),
 
136
    .codec_ids      = { AV_CODEC_ID_MPEG4 },
 
137
    .priv_data_size = sizeof(struct Mp4vParseContext),
136
138
    .parser_init    = mpeg4video_parse_init,
137
139
    .parser_parse   = mpeg4video_parse,
138
 
    .parser_close   = ff_parse1_close,
 
140
    .parser_close   = ff_parse_close,
139
141
    .split          = ff_mpeg4video_split,
140
142
};