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., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
21 #ifndef __GST_FFMPEGPIPE_H__
22 #define __GST_FFMPEGPIPE_H__
24 #include <gst/base/gstadapter.h>
25 #include "gstffmpeg.h"
29 /* pipe protocol helpers */
30 #define GST_FFMPEG_PIPE_MUTEX_LOCK(m) G_STMT_START { \
31 GST_LOG_OBJECT (m, "locking tlock from thread %p", g_thread_self ()); \
32 g_mutex_lock (m->tlock); \
33 GST_LOG_OBJECT (m, "locked tlock from thread %p", g_thread_self ()); \
36 #define GST_FFMPEG_PIPE_MUTEX_UNLOCK(m) G_STMT_START { \
37 GST_LOG_OBJECT (m, "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_OBJECT (m, "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_OBJECT (m, "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 */
72 #endif /* __GST_FFMPEGPIPE_H__ */