[SCM] libav/experimental: Extend URLProtocol with new function pointers and api functions for av_url_read_play(), av_url_read_pause() and av_url_read_seek().

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:09:45 UTC 2013


The following commit has been merged in the experimental branch:
commit 536333a0fe2e20bd7314a589635f08a451d1e12e
Author: Björn Axelsson <gecko at acc.umu.se>
Date:   Sat Nov 24 07:09:32 2007 +0000

    Extend URLProtocol with new function pointers and api functions for
    av_url_read_play(), av_url_read_pause() and av_url_read_seek().
    
    patch by: Björn Axelsson, bjorn d axelsson a intinor d se
    
    Originally committed as revision 11086 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavformat/avio.c b/libavformat/avio.c
index 793f8ab..234a99a 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -187,3 +187,25 @@ void url_set_interrupt_cb(URLInterruptCB *interrupt_cb)
         interrupt_cb = default_interrupt_cb;
     url_interrupt_cb = interrupt_cb;
 }
+
+int av_url_read_play(URLContext *h)
+{
+    if (!h->prot->url_read_play)
+        return AVERROR(ENOSYS);
+    return h->prot->url_read_play(h);
+}
+
+int av_url_read_pause(URLContext *h)
+{
+    if (!h->prot->url_read_pause)
+        return AVERROR(ENOSYS);
+    return h->prot->url_read_pause(h);
+}
+
+int av_url_read_seek(URLContext *h,
+        int stream_index, int64_t timestamp, int flags)
+{
+    if (!h->prot->url_read_seek)
+        return AVERROR(ENOSYS);
+    return h->prot->url_read_seek(h, stream_index, timestamp, flags);
+}
diff --git a/libavformat/avio.h b/libavformat/avio.h
index 89a347b..138508e 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -86,6 +86,32 @@ void url_set_interrupt_cb(URLInterruptCB *interrupt_cb);
 /* not implemented */
 int url_poll(URLPollEntry *poll_table, int n, int timeout);
 
+/** Start playing or resume paused playout. Only meaningful if using a network
+ * streaming protocol (e.g. MMS). */
+int av_url_read_play(URLContext *h);
+/** Pause playing - only meaningful if using a network streaming protocol
+ * (e.g. MMS). */
+int av_url_read_pause(URLContext *h);
+/**
+ * Seek to a given timestamp relative to some component stream.
+ * Only meaningful if using a network streaming protocol (e.g. MMS.)
+ * @param stream_index The stream index that the timestamp is relative to.
+ *        If stream_index is (-1) the timestamp should be in AV_TIME_BASE
+ *        units from the beginning of the presentation.
+ *        If a stream_index >= 0 is used and the protocol does not support
+ *        seeking based on component streams, the call will fail with ENOTSUP.
+ * @param time_stamp timestamp timestamp in AVStream.time_base units
+ *        or if there is no stream specified then in AV_TIME_BASE units.
+ * @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE
+ *        and AVSEEK_FLAG_ANY. The protocol may silently ignore
+ *        AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will
+ *        fail with ENOTSUP if used and not supported.
+ * @return >= 0 on success
+ * @see AVInputFormat::read_seek
+ */
+int av_url_read_seek(URLContext *h,
+                     int stream_index, int64_t timestamp, int flags);
+
 /**
  * Passing this as the "whence" parameter to a seek function causes it to
  * return the filesize without seeking anywhere. Supporting this is optional.
@@ -101,6 +127,10 @@ typedef struct URLProtocol {
     offset_t (*url_seek)(URLContext *h, offset_t pos, int whence);
     int (*url_close)(URLContext *h);
     struct URLProtocol *next;
+    int (*url_read_play)(URLContext *h);
+    int (*url_read_pause)(URLContext *h);
+    int (*url_read_seek)(URLContext *h,
+                         int stream_index, int64_t timestamp, int flags);
 } URLProtocol;
 
 extern URLProtocol *first_protocol;

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list