summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <bilboed@bilboed.com>2015-02-20 12:30:22 +0100
committerEdward Hervey <bilboed@bilboed.com>2015-03-11 10:39:38 +0100
commit21c7ca720cdddd6ad3c877ee8989e383f48d2942 (patch)
tree21345d0bb47efd1666e8b75910b1d6a5d8cb88e3
parentccdb7139d7b200ecfd8c78312e1e2da1807f920b (diff)
WIP FIX INTEL PART 2
-rw-r--r--sys/androidmedia/gstamc-constants.h1
-rw-r--r--sys/androidmedia/gstamc.c10
-rw-r--r--sys/androidmedia/gstamcsurface.c8
-rw-r--r--sys/androidmedia/gstamcsurfacetexture.c30
-rw-r--r--sys/androidmedia/gstamcvideodec.c10
-rw-r--r--sys/androidmedia/gstamcvideomemory.c3
-rw-r--r--sys/androidmedia/gstjniutils.c12
7 files changed, 50 insertions, 24 deletions
diff --git a/sys/androidmedia/gstamc-constants.h b/sys/androidmedia/gstamc-constants.h
index 048d6dd45..4ea644327 100644
--- a/sys/androidmedia/gstamc-constants.h
+++ b/sys/androidmedia/gstamc-constants.h
@@ -95,6 +95,7 @@ enum
COLOR_FormatAndroidOpaque = 0x7F000789,
COLOR_TI_FormatYUV420PackedSemiPlanar = 0x7f000100,
COLOR_INTEL_FormatYUV420PackedSemiPlanar = 0x7fa00e00,
+ COLOR_INTEL_FormatYUV420PackedSemiPlanar_Tiled = 0x7fa00f00,
COLOR_QCOM_FormatYUV420SemiPlanar = 0x7fa30c00,
COLOR_QCOM_FormatYUV420PackedSemiPlanar64x32Tile2m8ka = 0x7fa30c03,
/* NV12 but with stride and plane heights aligned to 32 */
diff --git a/sys/androidmedia/gstamc.c b/sys/androidmedia/gstamc.c
index 2a8afa2fa..63473cfd1 100644
--- a/sys/androidmedia/gstamc.c
+++ b/sys/androidmedia/gstamc.c
@@ -2132,6 +2132,7 @@ static const struct
COLOR_TI_FormatYUV420PackedSemiPlanar, GST_VIDEO_FORMAT_NV12}, {
COLOR_TI_FormatYUV420PackedSemiPlanarInterlaced, GST_VIDEO_FORMAT_NV12}, {
COLOR_INTEL_FormatYUV420PackedSemiPlanar, GST_VIDEO_FORMAT_NV12}, {
+ COLOR_INTEL_FormatYUV420PackedSemiPlanar_Tiled, GST_VIDEO_FORMAT_NV12}, {
COLOR_QCOM_FormatYUV420SemiPlanar, GST_VIDEO_FORMAT_NV12}, {
COLOR_QCOM_FormatYUV420PackedSemiPlanar64x32Tile2m8ka, GST_VIDEO_FORMAT_NV12}, {
COLOR_QCOM_FormatYVU420SemiPlanar32m, GST_VIDEO_FORMAT_NV12}, {
@@ -2331,6 +2332,15 @@ gst_amc_color_format_info_set (GstAmcColorFormatInfo * color_format_info,
1) / 2);
break;
}
+ case COLOR_INTEL_FormatYUV420PackedSemiPlanar:
+ case COLOR_INTEL_FormatYUV420PackedSemiPlanar_Tiled:
+ if (stride == 0 || slice_height == 0) {
+ GST_ERROR ("Stride or slice height is 0");
+ return FALSE;
+ }
+
+ break;
+
case COLOR_TI_FormatYUV420PackedSemiPlanar:
case COLOR_TI_FormatYUV420PackedSemiPlanarInterlaced:{
if (stride == 0 || slice_height == 0) {
diff --git a/sys/androidmedia/gstamcsurface.c b/sys/androidmedia/gstamcsurface.c
index 53f43eb5d..34e3c5049 100644
--- a/sys/androidmedia/gstamcsurface.c
+++ b/sys/androidmedia/gstamcsurface.c
@@ -84,7 +84,7 @@ gst_amc_surface_dispose (GObject * object)
{
GstAmcSurface *self;
JNIEnv *env;
- GError * err = NULL;
+ GError *err = NULL;
self = GST_AMC_SURFACE (object);
env = gst_amc_jni_get_env ();
@@ -138,7 +138,8 @@ gst_amc_surface_is_valid (GstAmcSurface * self, GError ** err)
env = gst_amc_jni_get_env ();
klass = GST_AMC_SURFACE_GET_CLASS (self);
- return gst_amc_jni_call_boolean_method (env, err, self->jobject, klass->is_valid);
+ return gst_amc_jni_call_boolean_method (env, err, self->jobject,
+ klass->is_valid);
}
gboolean
@@ -162,5 +163,6 @@ gst_amc_surface_describe_contents (GstAmcSurface * self, GError ** err)
env = gst_amc_jni_get_env ();
klass = GST_AMC_SURFACE_GET_CLASS (self);
- return gst_amc_jni_call_int_method(env, err, self->jobject, klass->describe_contents);
+ return gst_amc_jni_call_int_method (env, err, self->jobject,
+ klass->describe_contents);
}
diff --git a/sys/androidmedia/gstamcsurfacetexture.c b/sys/androidmedia/gstamcsurfacetexture.c
index 2cf211bbc..6a0d458db 100644
--- a/sys/androidmedia/gstamcsurfacetexture.c
+++ b/sys/androidmedia/gstamcsurfacetexture.c
@@ -171,11 +171,13 @@ gst_amc_surface_texture_set_default_buffer_size (GstAmcSurfaceTexture * self,
env = gst_amc_jni_get_env ();
klass = GST_AMC_SURFACE_TEXTURE_GET_CLASS (self);
- return gst_amc_jni_call_void_method (env, err, self->jobject, klass->set_default_buffer_size, width, height);
+ return gst_amc_jni_call_void_method (env, err, self->jobject,
+ klass->set_default_buffer_size, width, height);
}
gboolean
-gst_amc_surface_texture_update_tex_image (GstAmcSurfaceTexture * self, GError ** err)
+gst_amc_surface_texture_update_tex_image (GstAmcSurfaceTexture * self,
+ GError ** err)
{
JNIEnv *env;
GstAmcSurfaceTextureClass *klass;
@@ -183,11 +185,13 @@ gst_amc_surface_texture_update_tex_image (GstAmcSurfaceTexture * self, GError **
env = gst_amc_jni_get_env ();
klass = GST_AMC_SURFACE_TEXTURE_GET_CLASS (self);
- return gst_amc_jni_call_void_method (env, err, self->jobject, klass->update_tex_image);
+ return gst_amc_jni_call_void_method (env, err, self->jobject,
+ klass->update_tex_image);
}
gboolean
-gst_amc_surface_texture_detach_from_gl_context (GstAmcSurfaceTexture * self, GError ** err)
+gst_amc_surface_texture_detach_from_gl_context (GstAmcSurfaceTexture * self,
+ GError ** err)
{
JNIEnv *env;
gboolean ret;
@@ -196,7 +200,9 @@ gst_amc_surface_texture_detach_from_gl_context (GstAmcSurfaceTexture * self, GEr
env = gst_amc_jni_get_env ();
klass = GST_AMC_SURFACE_TEXTURE_GET_CLASS (self);
- ret = gst_amc_jni_call_void_method (env, err, self->jobject, klass->detach_from_gl_context);
+ ret =
+ gst_amc_jni_call_void_method (env, err, self->jobject,
+ klass->detach_from_gl_context);
self->texture_id = 0;
return ret;
}
@@ -212,7 +218,9 @@ gst_amc_surface_texture_attach_to_gl_context (GstAmcSurfaceTexture * self,
env = gst_amc_jni_get_env ();
klass = GST_AMC_SURFACE_TEXTURE_GET_CLASS (self);
- ret = gst_amc_jni_call_void_method (env, err, self->jobject, klass->attach_to_gl_context, texture_id);
+ ret =
+ gst_amc_jni_call_void_method (env, err, self->jobject,
+ klass->attach_to_gl_context, texture_id);
self->texture_id = texture_id;
return ret;
}
@@ -232,7 +240,9 @@ gst_amc_surface_texture_get_transform_matrix (GstAmcSurfaceTexture * self,
klass = GST_AMC_SURFACE_TEXTURE_GET_CLASS (self);
floatarray = (*env)->NewFloatArray (env, size);
- ret = gst_amc_jni_call_void_method (env, err, self->jobject, klass->get_transform_matrix, floatarray);
+ ret =
+ gst_amc_jni_call_void_method (env, err, self->jobject,
+ klass->get_transform_matrix, floatarray);
if (ret) {
(*env)->GetFloatArrayRegion (env, floatarray, 0, size, (jfloat *) matrix);
(*env)->DeleteLocalRef (env, floatarray);
@@ -242,7 +252,8 @@ gst_amc_surface_texture_get_transform_matrix (GstAmcSurfaceTexture * self,
}
gint64
-gst_amc_surface_texture_get_timestamp (GstAmcSurfaceTexture * self, GError ** err)
+gst_amc_surface_texture_get_timestamp (GstAmcSurfaceTexture * self,
+ GError ** err)
{
JNIEnv *env;
GstAmcSurfaceTextureClass *klass;
@@ -250,7 +261,8 @@ gst_amc_surface_texture_get_timestamp (GstAmcSurfaceTexture * self, GError ** er
env = gst_amc_jni_get_env ();
klass = GST_AMC_SURFACE_TEXTURE_GET_CLASS (self);
- return (gint64) gst_amc_jni_call_long_method (env, err, self->jobject, klass->get_timestamp);
+ return (gint64) gst_amc_jni_call_long_method (env, err, self->jobject,
+ klass->get_timestamp);
}
gboolean
diff --git a/sys/androidmedia/gstamcvideodec.c b/sys/androidmedia/gstamcvideodec.c
index 34b331917..959e42fde 100644
--- a/sys/androidmedia/gstamcvideodec.c
+++ b/sys/androidmedia/gstamcvideodec.c
@@ -379,14 +379,14 @@ gst_amc_video_dec_change_state (GstElement * element, GstStateChange transition)
GST_INFO ("Freeing GL context: %" GST_PTR_FORMAT, self->gl_context);
if (self->gl_context) {
- gst_object_unref (self->gl_context);
- self->gl_context = NULL;
+ gst_object_unref (self->gl_context);
+ self->gl_context = NULL;
}
GST_INFO ("Freeing GL renderer: %p", self->renderer);
if (self->renderer) {
- gst_amc_2d_texture_renderer_free (self->renderer);
- self->renderer = NULL;
+ gst_amc_2d_texture_renderer_free (self->renderer);
+ self->renderer = NULL;
}
break;
@@ -744,7 +744,7 @@ retry:
_find_nearest_frame (self,
gst_util_uint64_scale (buffer_info.presentation_time_us, GST_USECOND, 1));
- is_eos = !!(buffer_info.flags & BUFFER_FLAG_END_OF_STREAM);
+ is_eos = ! !(buffer_info.flags & BUFFER_FLAG_END_OF_STREAM);
if (frame
&& (deadline =
diff --git a/sys/androidmedia/gstamcvideomemory.c b/sys/androidmedia/gstamcvideomemory.c
index d3b4adb4a..96855646d 100644
--- a/sys/androidmedia/gstamcvideomemory.c
+++ b/sys/androidmedia/gstamcvideomemory.c
@@ -254,7 +254,8 @@ gst_amc_video_buffer_gl_texture_upload (GstVideoGLTextureUploadMeta * meta,
if (attach) {
GST_ERROR ("Attaching surface texture to texture %d", texture_id[0]);
- if (!gst_amc_surface_texture_attach_to_gl_context (surface_texture, texture_id[0], &err)) {
+ if (!gst_amc_surface_texture_attach_to_gl_context (surface_texture,
+ texture_id[0], &err)) {
if (err) {
GST_ERROR ("Error: %s", err->message);
g_clear_error (&err);
diff --git a/sys/androidmedia/gstjniutils.c b/sys/androidmedia/gstjniutils.c
index b370e5163..065d3316d 100644
--- a/sys/androidmedia/gstjniutils.c
+++ b/sys/androidmedia/gstjniutils.c
@@ -673,9 +673,9 @@ _type gst_amc_jni_call_##_name##_method (JNIEnv *env, GError ** err, jobject obj
}
CALL_TYPE_METHOD (gboolean, boolean, Boolean, FALSE)
-CALL_TYPE_METHOD (gint8, byte, Byte, G_MININT8)
-CALL_TYPE_METHOD (gshort, short, Short, G_MINSHORT)
-CALL_TYPE_METHOD (gint, int, Int, G_MININT)
+ CALL_TYPE_METHOD (gint8, byte, Byte, G_MININT8)
+ CALL_TYPE_METHOD (gshort, short, Short, G_MINSHORT)
+ CALL_TYPE_METHOD (gint, int, Int, G_MININT)
CALL_TYPE_METHOD (gchar, char, Char, 0)
CALL_TYPE_METHOD (glong, long, Long, G_MINLONG)
CALL_TYPE_METHOD (gfloat, float, Float, G_MINFLOAT)
@@ -683,8 +683,8 @@ CALL_TYPE_METHOD (gdouble, double, Double, G_MINDOUBLE)
CALL_TYPE_METHOD (jobject, object, Object, NULL)
gboolean
-gst_amc_jni_call_void_method (JNIEnv * env, GError ** err, jobject obj, jmethodID methodID,
- ...)
+gst_amc_jni_call_void_method (JNIEnv * env, GError ** err, jobject obj,
+ jmethodID methodID, ...)
{
gboolean ret = TRUE;
va_list args;
@@ -717,4 +717,4 @@ _type gst_amc_jni_get_##_name##_field (JNIEnv *env, GError ** err, jobject obj,
}
GET_TYPE_FIELD (gint, int, Int, G_MININT)
-GET_TYPE_FIELD (glong, long, Long, G_MINLONG)
+ GET_TYPE_FIELD (glong, long, Long, G_MINLONG)