diff options
author | Mark Nauwelaerts <manauw@skynet.be> | 2006-07-13 11:06:45 +0000 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.net> | 2006-07-13 11:06:45 +0000 |
commit | 676eafc77c2799521925d54ba43b26df72c76b14 (patch) | |
tree | de46f5bf8f22a83cd7a55fa1cdb26507986e22fd /ext/mpeg2enc/gstmpeg2enc.hh | |
parent | 0e9af4401ec81f82b3b4d7f548a96b2585f1e0e1 (diff) | |
download | gst-plugins-bad-676eafc77c2799521925d54ba43b26df72c76b14.tar.gz gst-plugins-bad-676eafc77c2799521925d54ba43b26df72c76b14.tar.bz2 gst-plugins-bad-676eafc77c2799521925d54ba43b26df72c76b14.zip |
Port mpeg2enc to 0.10 (#343184).
Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet be>
* configure.ac:
* ext/Makefile.am:
* ext/mpeg2enc/Makefile.am:
* ext/mpeg2enc/gstmpeg2enc.cc:
* ext/mpeg2enc/gstmpeg2enc.hh:
* ext/mpeg2enc/gstmpeg2encoder.cc:
* ext/mpeg2enc/gstmpeg2encoder.hh:
* ext/mpeg2enc/gstmpeg2encoptions.cc:
* ext/mpeg2enc/gstmpeg2encpicturereader.cc:
* ext/mpeg2enc/gstmpeg2encpicturereader.hh:
* ext/mpeg2enc/gstmpeg2encstreamwriter.cc:
* ext/mpeg2enc/gstmpeg2encstreamwriter.hh:
Port mpeg2enc to 0.10 (#343184).
* tests/check/Makefile.am:
* tests/check/elements/.cvsignore:
* tests/check/elements/mpeg2enc.c:
Add unit test for mpeg2enc.
* tests/icles/.cvsignore:
Ignore pitch-test.
Diffstat (limited to 'ext/mpeg2enc/gstmpeg2enc.hh')
-rw-r--r-- | ext/mpeg2enc/gstmpeg2enc.hh | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/ext/mpeg2enc/gstmpeg2enc.hh b/ext/mpeg2enc/gstmpeg2enc.hh index 25c61e61..66e799a0 100644 --- a/ext/mpeg2enc/gstmpeg2enc.hh +++ b/ext/mpeg2enc/gstmpeg2enc.hh @@ -1,5 +1,6 @@ /* GStreamer mpeg2enc (mjpegtools) wrapper * (c) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net> + * (c) 2006 Mark Nauwelaerts <manauw@skynet.be> * * gstmpeg2enc.hh: object definition * @@ -39,6 +40,30 @@ G_BEGIN_DECLS #define GST_IS_MPEG2ENC_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MPEG2ENC)) +GST_DEBUG_CATEGORY_EXTERN (mpeg2enc_debug); +#define GST_CAT_DEFAULT mpeg2enc_debug + +#define GST_MPEG2ENC_MUTEX_LOCK(m) G_STMT_START { \ + GST_LOG_OBJECT (m, "locking tlock from thread %p", g_thread_self ()); \ + g_mutex_lock (m->tlock); \ + GST_LOG_OBJECT (m, "locked tlock from thread %p", g_thread_self ()); \ +} G_STMT_END + +#define GST_MPEG2ENC_MUTEX_UNLOCK(m) G_STMT_START { \ + GST_LOG_OBJECT (m, "unlocking tlock from thread %p", g_thread_self ()); \ + g_mutex_unlock (m->tlock); \ +} G_STMT_END + +#define GST_MPEG2ENC_WAIT(m) G_STMT_START { \ + GST_LOG_OBJECT (m, "thread %p waiting", g_thread_self ()); \ + g_cond_wait (m->cond, m->tlock); \ +} G_STMT_END + +#define GST_MPEG2ENC_SIGNAL(m) G_STMT_START { \ + GST_LOG_OBJECT (m, "signalling from thread %p", g_thread_self ()); \ + g_cond_signal (m->cond); \ +} G_STMT_END + typedef struct _GstMpeg2enc { GstElement parent; @@ -50,6 +75,20 @@ typedef struct _GstMpeg2enc { /* general encoding object (contains rest) */ GstMpeg2Encoder *encoder; + + /* lock for syncing with encoding task */ + GMutex *tlock; + /* with TLOCK */ + /* signals counterpart thread that something changed; + * buffer ready for task or buffer has been processed */ + GCond *cond; + /* seen eos */ + gboolean eos; + /* flowreturn obtained by encoding task */ + GstFlowReturn srcresult; + /* buffer for encoding task */ + GstBuffer *buffer; + } GstMpeg2enc; typedef struct _GstMpeg2encClass { |