[Redbutton-devel] SF.net SVN: redbutton:[549] redbutton-browser/trunk
Brought to you by:
skilvington
|
From: <ski...@us...> - 2011-09-14 17:52:13
|
Revision: 549
http://redbutton.svn.sourceforge.net/redbutton/?rev=549&view=rev
Author: skilvington
Date: 2011-09-14 17:52:07 +0000 (Wed, 14 Sep 2011)
Log Message:
-----------
make our own copies of some deprecated ffmpeg functions
Modified Paths:
--------------
redbutton-browser/trunk/MHEGDisplay.c
redbutton-browser/trunk/MHEGStreamPlayer.c
redbutton-browser/trunk/utils.c
redbutton-browser/trunk/utils.h
Modified: redbutton-browser/trunk/MHEGDisplay.c
===================================================================
--- redbutton-browser/trunk/MHEGDisplay.c 2011-06-02 08:19:51 UTC (rev 548)
+++ redbutton-browser/trunk/MHEGDisplay.c 2011-09-14 17:52:07 UTC (rev 549)
@@ -895,14 +895,14 @@
size = mpeg->size;
do
{
- used = avcodec_decode_video(codec_ctx, yuv_frame, &got_picture, data, size);
+ used = my_avcodec_decode_video(codec_ctx, yuv_frame, &got_picture, data, size);
data += used;
size -= used;
}
while(!got_picture && size > 0);
/* need to call it one final time with size=0, to actually get the frame */
if(!got_picture)
- (void) avcodec_decode_video(codec_ctx, yuv_frame, &got_picture, data, size);
+ (void) my_avcodec_decode_video(codec_ctx, yuv_frame, &got_picture, data, size);
if(!got_picture)
{
Modified: redbutton-browser/trunk/MHEGStreamPlayer.c
===================================================================
--- redbutton-browser/trunk/MHEGStreamPlayer.c 2011-06-02 08:19:51 UTC (rev 548)
+++ redbutton-browser/trunk/MHEGStreamPlayer.c 2011-09-14 17:52:07 UTC (rev 549)
@@ -512,7 +512,7 @@
{
audio_frame = new_AudioFrameListItem();
af = &audio_frame->item;
- used = avcodec_decode_audio2(audio_codec_ctx, (int16_t *) af->data, (int *) &af->size, data, size);
+ used = my_avcodec_decode_audio2(audio_codec_ctx, (int16_t *) af->data, (int *) &af->size, data, size);
data += used;
size -= used;
if(used > 0 && af->size > 0)
@@ -541,7 +541,7 @@
}
else if(p->have_video && pkt.stream_index == p->video_pid && pkt.dts != AV_NOPTS_VALUE)
{
- (void) avcodec_decode_video(video_codec_ctx, frame, &got_picture, pkt.data, pkt.size);
+ (void) my_avcodec_decode_video(video_codec_ctx, frame, &got_picture, pkt.data, pkt.size);
if(got_picture)
{
pts = pkt.dts / video_time_base;
Modified: redbutton-browser/trunk/utils.c
===================================================================
--- redbutton-browser/trunk/utils.c 2011-06-02 08:19:51 UTC (rev 548)
+++ redbutton-browser/trunk/utils.c 2011-09-14 17:52:07 UTC (rev 549)
@@ -69,6 +69,32 @@
return fmt;
}
+/* deprecated FFMPEG functions that have now been removed */
+int
+my_avcodec_decode_audio2(AVCodecContext *avctx, int16_t *samples, int *frame_size_ptr, const uint8_t *buf, int buf_size)
+{
+ AVPacket avpkt;
+ av_init_packet(&avpkt);
+ avpkt.data = (uint8_t *) buf;
+ avpkt.size = buf_size;
+
+ return avcodec_decode_audio3(avctx, samples, frame_size_ptr, &avpkt);
+}
+
+int
+my_avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, const uint8_t *buf, int buf_size)
+{
+ AVPacket avpkt;
+ av_init_packet(&avpkt);
+ avpkt.data = (uint8_t *) buf;
+ avpkt.size = buf_size;
+ // HACK for CorePNG to decode as normal PNG by default
+ avpkt.flags = AV_PKT_FLAG_KEY;
+
+ return avcodec_decode_video2(avctx, picture, got_picture_ptr, &avpkt);
+}
+
+
/*
* returns 15 for 'f' etc
*/
Modified: redbutton-browser/trunk/utils.h
===================================================================
--- redbutton-browser/trunk/utils.h 2011-06-02 08:19:51 UTC (rev 548)
+++ redbutton-browser/trunk/utils.h 2011-09-14 17:52:07 UTC (rev 549)
@@ -41,6 +41,10 @@
enum PixelFormat find_av_pix_fmt(int, unsigned long, unsigned long, unsigned long);
+/* deprecated FFMPEG functions that have now been removed */
+int my_avcodec_decode_audio2(AVCodecContext *, int16_t *, int *, const uint8_t *, int);
+int my_avcodec_decode_video(AVCodecContext *, AVFrame *, int *, const uint8_t *, int);
+
unsigned int char2hex(unsigned char);
int next_utf8(unsigned char *, int, int *);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|