2 * Copyright (C) <2006> Mark Nauwelaerts <manauw@skynet.be>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
21 #ifndef __GST_FFMPEGPROTOCOL_H__
22 #define __GST_FFMPEGPROTOCOL_H__
24 #include <gst/base/gstadapter.h>
29 /* pipe protocol helpers */
30 #define GST_FFMPEG_PIPE_MUTEX_LOCK(m) G_STMT_START { \
31 GST_LOG ("locking tlock from thread %p", g_thread_self ()); \
32 g_mutex_lock (&m->tlock); \
33 GST_LOG ("locked tlock from thread %p", g_thread_self ()); \
36 #define GST_FFMPEG_PIPE_MUTEX_UNLOCK(m) G_STMT_START { \
37 GST_LOG ("unlocking tlock from thread %p", g_thread_self ()); \
38 g_mutex_unlock (&m->tlock); \
41 #define GST_FFMPEG_PIPE_WAIT(m) G_STMT_START { \
42 GST_LOG ("thread %p waiting", g_thread_self ()); \
43 g_cond_wait (&m->cond, &m->tlock); \
46 #define GST_FFMPEG_PIPE_SIGNAL(m) G_STMT_START { \
47 GST_LOG ("signalling from thread %p", g_thread_self ()); \
48 g_cond_signal (&m->cond); \
51 typedef struct _GstFFMpegPipe GstFFMpegPipe;
55 /* lock for syncing */
58 /* signals counterpart thread to have a look */
62 /* flowreturn obtained by src task */
63 GstFlowReturn srcresult;
64 /* adpater collecting data */
66 /* amount needed in adapter by src task */
70 int gst_ffmpeg_pipe_open (GstFFMpegPipe *ffpipe, int flags, AVIOContext ** context);
71 int gst_ffmpeg_pipe_close (AVIOContext * h);
73 int gst_ffmpegdata_open (GstPad * pad, int flags, AVIOContext ** context);
74 int gst_ffmpegdata_close (AVIOContext * h);
78 #endif /* __GST_FFMPEGPROTOCOL_H__ */