Line
Link Here
|
0 |
-- grass-6.4.1.orig/lib/ogsf/gsd_img_mpeg.c |
0 |
++ grass-6.4.1/lib/ogsf/gsd_img_mpeg.c |
Lines 66-72
static AVStream *add_video_stream(AVForm
Link Here
|
66 |
|
66 |
|
67 |
c = st->codec; |
67 |
c = st->codec; |
68 |
c->codec_id = codec_id; |
68 |
c->codec_id = codec_id; |
69 |
c->codec_type = CODEC_TYPE_VIDEO; |
69 |
c->codec_type = AVMEDIA_TYPE_VIDEO; |
70 |
|
70 |
|
71 |
/* put sample parameters */ |
71 |
/* put sample parameters */ |
72 |
c->bit_rate = 400000; |
72 |
c->bit_rate = 400000; |
Lines 215-221
static void write_video_frame(AVFormatCo
Link Here
|
215 |
|
215 |
|
216 |
av_init_packet(&pkt); |
216 |
av_init_packet(&pkt); |
217 |
|
217 |
|
218 |
pkt.flags |= PKT_FLAG_KEY; |
218 |
pkt.flags |= AV_PKT_FLAG_KEY; |
219 |
pkt.stream_index = st->index; |
219 |
pkt.stream_index = st->index; |
220 |
pkt.data = (uint8_t *) picture; |
220 |
pkt.data = (uint8_t *) picture; |
221 |
pkt.size = sizeof(AVPicture); |
221 |
pkt.size = sizeof(AVPicture); |
Lines 236-242
static void write_video_frame(AVFormatCo
Link Here
|
236 |
av_rescale_q(c->coded_frame->pts, c->time_base, |
236 |
av_rescale_q(c->coded_frame->pts, c->time_base, |
237 |
st->time_base); |
237 |
st->time_base); |
238 |
if (c->coded_frame->key_frame) |
238 |
if (c->coded_frame->key_frame) |
239 |
pkt.flags |= PKT_FLAG_KEY; |
239 |
pkt.flags |= AV_PKT_FLAG_KEY; |
240 |
pkt.stream_index = st->index; |
240 |
pkt.stream_index = st->index; |
241 |
pkt.data = video_outbuf; |
241 |
pkt.data = video_outbuf; |
242 |
pkt.size = out_size; |
242 |
pkt.size = out_size; |
Lines 301-310
int gsd_init_mpeg(const char *filename)
Link Here
|
301 |
av_register_all(); |
301 |
av_register_all(); |
302 |
|
302 |
|
303 |
/* auto detect the output format from the name. default is mpeg. */ |
303 |
/* auto detect the output format from the name. default is mpeg. */ |
304 |
fmt = guess_format(NULL, filename, NULL); |
304 |
fmt = av_guess_format(NULL, filename, NULL); |
305 |
if (!fmt) { |
305 |
if (!fmt) { |
306 |
G_warning(_("Unable to deduce output format from file extension: using MPEG")); |
306 |
G_warning(_("Unable to deduce output format from file extension: using MPEG")); |
307 |
fmt = guess_format("mpeg", NULL, NULL); |
307 |
fmt = av_guess_format("mpeg", NULL, NULL); |
308 |
} |
308 |
} |
309 |
if (!fmt) { |
309 |
if (!fmt) { |
310 |
G_warning(_("Unable to find suitable output format")); |
310 |
G_warning(_("Unable to find suitable output format")); |
Lines 312-318
int gsd_init_mpeg(const char *filename)
Link Here
|
312 |
} |
312 |
} |
313 |
|
313 |
|
314 |
/* allocate the output media context */ |
314 |
/* allocate the output media context */ |
315 |
oc = av_alloc_format_context(); |
315 |
oc = av_malloc(sizeof(AVFormatContext)); |
316 |
if (!oc) { |
316 |
if (!oc) { |
317 |
G_warning(_("Out of memory")); |
317 |
G_warning(_("Out of memory")); |
318 |
return (-1); |
318 |
return (-1); |