r34632 - trunk/stream/stream_ffmpeg.c
Author: reimar Date: Sat Jan 28 14:47:01 2012 New Revision: 34632 Log: Some hacks to allow stream_ffmpeg to compile against newer FFmpeg. Keep the old code so that it is still possible to compile against older FFmpeg without using internal API. Modified: trunk/stream/stream_ffmpeg.c Modified: trunk/stream/stream_ffmpeg.c ============================================================================== --- trunk/stream/stream_ffmpeg.c Sat Jan 28 14:22:57 2012 (r34631) +++ trunk/stream/stream_ffmpeg.c Sat Jan 28 14:47:01 2012 (r34632) @@ -26,6 +26,16 @@ #include "m_struct.h" #include "av_helpers.h" +#ifndef URL_RDONLY +#include "libavformat/url.h" +#define url_read_complete ffurl_read_complete +#define url_write ffurl_write +#define url_seek ffurl_seek +#define url_filesize ffurl_size +#define url_close ffurl_close +#define url_open(c, n, f) ffurl_open(c, n, f, NULL, NULL) +#endif + static int fill_buffer(stream_t *s, char *buffer, int max_len) { int r = url_read_complete(s->priv, buffer, max_len); @@ -51,6 +61,7 @@ static int seek(stream_t *s, off_t newpo static int control(stream_t *s, int cmd, void *arg) { + URLContext *ctx = s->priv; int64_t size, ts; double pts; switch(cmd) { @@ -64,7 +75,13 @@ static int control(stream_t *s, int cmd, case STREAM_CTRL_SEEK_TO_TIME: pts = *(double *)arg; ts = pts * AV_TIME_BASE; +#ifdef URL_RDONLY ts = av_url_read_seek(s->priv, -1, ts, 0); +#else + if (!ctx->prot->url_read_seek) + break; + ts = ctx->prot->url_read_seek(s->priv, -1, ts, 0); +#endif if (ts >= 0) return 1; break; @@ -90,9 +107,9 @@ static int open_f(stream_t *stream, int init_avformat(); if (mode == STREAM_READ) - flags = URL_RDONLY; + flags = AVIO_FLAG_READ; else if (mode == STREAM_WRITE) - flags = URL_WRONLY; + flags = AVIO_FLAG_WRITE; else { mp_msg(MSGT_OPEN, MSGL_ERR, "[ffmpeg] Unknown open mode %d\n", mode); res = STREAM_UNSUPPORTED;
reimar wrote on Sat, 28 Jan 2012 14:47:01 +0100 (CET):
Author: reimar Date: Sat Jan 28 14:47:01 2012 New Revision: 34632
Log: Some hacks to allow stream_ffmpeg to compile against newer FFmpeg.
Keep the old code so that it is still possible to compile against older FFmpeg without using internal API.
Modified: trunk/stream/stream_ffmpeg.c
Modified: trunk/stream/stream_ffmpeg.c ============================================================================== +++ trunk/stream/stream_ffmpeg.c Sat Jan 28 14:47:01 2012 (r34632) @@ -26,6 +26,16 @@ #include "m_struct.h" #include "av_helpers.h"
+#ifndef URL_RDONLY +#include "libavformat/url.h" +#define url_read_complete ffurl_read_complete +#define url_write ffurl_write +#define url_seek ffurl_seek +#define url_filesize ffurl_size +#define url_close ffurl_close +#define url_open(c, n, f) ffurl_open(c, n, f, NULL, NULL) +#endif
I have problems with shared ffmpeg (just cloned and compiled): LD mplayer stream/stream_ffmpeg.o: In function `open_f': stream_ffmpeg.c:(.text+0x12d): undefined reference to `ffurl_size' stream/stream_ffmpeg.o: In function `control': stream_ffmpeg.c:(.text+0x2a4): undefined reference to `ffurl_size' stream/stream_ffmpeg.o: In function `fill_buffer': stream_ffmpeg.c:(.text+0x31e): undefined reference to `ffurl_read_complete' stream/stream_ffmpeg.o: In function `seek': stream_ffmpeg.c:(.text+0x35d): undefined reference to `ffurl_seek' make: *** [mplayer] Error 1 Is diff --git a/libavformat/libavformat.v b/libavformat/libavformat.v index 6949884..e2fb65a 100644 --- a/libavformat/libavformat.v +++ b/libavformat/libavformat.v @@ -12,6 +12,9 @@ LIBAVFORMAT_$MAJOR { ffio_open_dyn_packet_buf; ffurl_close; ffurl_open; + ffurl_read_complete; + ffurl_seek; + ffurl_size; ffurl_write; url_open; url_close; the right way to fix it (and does it have a chance to get committed)? (I know, wrong mailing list to ask, but before I embarrass myself on ffmpeg-user...) Ingo
On Fri, Feb 10, 2012 at 12:47:02PM +0100, Ingo Brückl wrote:
reimar wrote on Sat, 28 Jan 2012 14:47:01 +0100 (CET):
Log: Some hacks to allow stream_ffmpeg to compile against newer FFmpeg.
Keep the old code so that it is still possible to compile against older FFmpeg without using internal API.
+++ trunk/stream/stream_ffmpeg.c Sat Jan 28 14:47:01 2012 (r34632) @@ -26,6 +26,16 @@ #include "m_struct.h" #include "av_helpers.h"
+#ifndef URL_RDONLY +#include "libavformat/url.h" +#define url_read_complete ffurl_read_complete +#define url_write ffurl_write +#define url_seek ffurl_seek +#define url_filesize ffurl_size +#define url_close ffurl_close +#define url_open(c, n, f) ffurl_open(c, n, f, NULL, NULL) +#endif
I have problems with shared ffmpeg (just cloned and compiled):
LD mplayer stream/stream_ffmpeg.o: In function `open_f': stream_ffmpeg.c:(.text+0x12d): undefined reference to `ffurl_size' stream/stream_ffmpeg.o: In function `control': stream_ffmpeg.c:(.text+0x2a4): undefined reference to `ffurl_size' stream/stream_ffmpeg.o: In function `fill_buffer': stream_ffmpeg.c:(.text+0x31e): undefined reference to `ffurl_read_complete' stream/stream_ffmpeg.o: In function `seek': stream_ffmpeg.c:(.text+0x35d): undefined reference to `ffurl_seek' make: *** [mplayer] Error 1
Is
diff --git a/libavformat/libavformat.v b/libavformat/libavformat.v index 6949884..e2fb65a 100644 --- a/libavformat/libavformat.v +++ b/libavformat/libavformat.v @@ -12,6 +12,9 @@ LIBAVFORMAT_$MAJOR { ffio_open_dyn_packet_buf; ffurl_close; ffurl_open; + ffurl_read_complete; + ffurl_seek; + ffurl_size; ffurl_write; url_open; url_close;
the right way to fix it (and does it have a chance to get committed)? (I know, wrong mailing list to ask, but before I embarrass myself on ffmpeg-user...)
The right way is to fix MPlayer not to misuse internal API, not export more symbols from libavformat. Diego
On 10 Feb 2012, at 15:18, Diego Biurrun <diego@biurrun.de> wrote:
On Fri, Feb 10, 2012 at 12:47:02PM +0100, Ingo Brückl wrote:
reimar wrote on Sat, 28 Jan 2012 14:47:01 +0100 (CET):
Log: Some hacks to allow stream_ffmpeg to compile against newer FFmpeg.
Keep the old code so that it is still possible to compile against older FFmpeg without using internal API.
+++ trunk/stream/stream_ffmpeg.c Sat Jan 28 14:47:01 2012 (r34632) @@ -26,6 +26,16 @@ #include "m_struct.h" #include "av_helpers.h"
+#ifndef URL_RDONLY +#include "libavformat/url.h" +#define url_read_complete ffurl_read_complete +#define url_write ffurl_write +#define url_seek ffurl_seek +#define url_filesize ffurl_size +#define url_close ffurl_close +#define url_open(c, n, f) ffurl_open(c, n, f, NULL, NULL) +#endif
I have problems with shared ffmpeg (just cloned and compiled):
LD mplayer stream/stream_ffmpeg.o: In function `open_f': stream_ffmpeg.c:(.text+0x12d): undefined reference to `ffurl_size' stream/stream_ffmpeg.o: In function `control': stream_ffmpeg.c:(.text+0x2a4): undefined reference to `ffurl_size' stream/stream_ffmpeg.o: In function `fill_buffer': stream_ffmpeg.c:(.text+0x31e): undefined reference to `ffurl_read_complete' stream/stream_ffmpeg.o: In function `seek': stream_ffmpeg.c:(.text+0x35d): undefined reference to `ffurl_seek' make: *** [mplayer] Error 1
Is
diff --git a/libavformat/libavformat.v b/libavformat/libavformat.v index 6949884..e2fb65a 100644 --- a/libavformat/libavformat.v +++ b/libavformat/libavformat.v @@ -12,6 +12,9 @@ LIBAVFORMAT_$MAJOR { ffio_open_dyn_packet_buf; ffurl_close; ffurl_open; + ffurl_read_complete; + ffurl_seek; + ffurl_size; ffurl_write; url_open; url_close;
the right way to fix it (and does it have a chance to get committed)? (I know, wrong mailing list to ask, but before I embarrass myself on ffmpeg-user...)
The right way is to fix MPlayer not to misuse internal API, not export more symbols from libavformat.
There is no suitable alternative to the (only now) internal API. FFmpeg should be easy enough to convince to expose the low-level API again. Libav probably not since they drove removing the old API without replacement.
Reimar Döffinger wrote on Fri, 10 Feb 2012 19:44:24 +0100:
There is no suitable alternative to the (only now) internal API. FFmpeg should be easy enough to convince to expose the low-level API again.
So you'd suggest sending the patch to the ffmpeg-user mailing-list? Ingo
On Fri, Feb 10, 2012 at 08:03:04PM +0100, Ingo Brückl wrote:
Reimar Döffinger wrote on Fri, 10 Feb 2012 19:44:24 +0100:
There is no suitable alternative to the (only now) internal API. FFmpeg should be easy enough to convince to expose the low-level API again.
So you'd suggest sending the patch to the ffmpeg-user mailing-list?
I guess you can send a patch on ffmpeg-devel similar to this one: http://git.videolan.org/?p=ffmpeg.git;a=commitdiff;h=fa94f8a8484474f1d1630c5... Also, see this: http://lists.ffmpeg.org/pipermail/ffmpeg-devel/2012-February/120575.html -- Clément B.
On Fri, Feb 10, 2012 at 08:03:04PM +0100, Ingo Brückl wrote:
Reimar Döffinger wrote on Fri, 10 Feb 2012 19:44:24 +0100:
There is no suitable alternative to the (only now) internal API. FFmpeg should be easy enough to convince to expose the low-level API again.
So you'd suggest sending the patch to the ffmpeg-user mailing-list?
ffmpeg-user not. ffmpeg-devel, however ffurl stuff probably shouldn't be make public. Instead the necessary functions should probably be exported with av_ prefix.
participants (5)
-
Clément Bœsch -
Diego Biurrun -
Ingo Brückl -
reimar -
Reimar Döffinger