[vlc-commits] mediacodec_ndk: set a config flag for config buffers

Thomas Guillem git at videolan.org
Mon Jun 1 14:49:09 CEST 2015


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Jun  1 14:30:41 2015 +0200| [3c1cf08e763155a9e25d262a7af1c8aaf7df6c63] | committer: Thomas Guillem

mediacodec_ndk: set a config flag for config buffers

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3c1cf08e763155a9e25d262a7af1c8aaf7df6c63
---

 modules/codec/omxil/mediacodec_ndk.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/modules/codec/omxil/mediacodec_ndk.c b/modules/codec/omxil/mediacodec_ndk.c
index 2d69963..9eec32d 100644
--- a/modules/codec/omxil/mediacodec_ndk.c
+++ b/modules/codec/omxil/mediacodec_ndk.c
@@ -42,6 +42,10 @@
 #define THREAD_NAME "mediacodec_ndk"
 extern JNIEnv *jni_get_env(const char *name);
 
+/* Not in NdkMedia API but we need it since we send config data via input
+ * buffers and not via "csd-*" buffers from AMediaFormat */
+#define AMEDIACODEC_FLAG_CODEC_CONFIG 2
+
 /*****************************************************************************
  * NdkMediaError.h
  *****************************************************************************/
@@ -392,7 +396,7 @@ static int PutInput(mc_api *api, const void *p_buf, size_t i_size,
     ssize_t i_index;
     uint8_t *p_mc_buf;
     size_t i_mc_size;
-    (void) b_config;
+    int i_flags = b_config ? AMEDIACODEC_FLAG_CODEC_CONFIG : 0;
 
     i_index = syms.AMediaCodec.dequeueInputBuffer(p_sys->p_codec, i_timeout);
     if (i_index < 0)
@@ -416,7 +420,7 @@ static int PutInput(mc_api *api, const void *p_buf, size_t i_size,
     memcpy(p_mc_buf, p_buf, i_mc_size);
 
     if (syms.AMediaCodec.queueInputBuffer(p_sys->p_codec, i_index, 0, i_mc_size,
-                                          i_ts, 0) == AMEDIA_OK)
+                                          i_ts, i_flags) == AMEDIA_OK)
         return 1;
     else
     {



More information about the vlc-commits mailing list