[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:gst-droid.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -2,7 +2,7 @@
<service name="tar_git">
<param name="url">https://github.com/sailfishos/gst-droid.git</param>
<param name="branch">master</param>
- <param name="revision">8d7a7648baae3db995383d0bec8d1ce10337710b</param>
+ <param name="revision">0.20191007.0</param>
<param name="token"/>
<param name="debian">N</param>
<param name="dumb">N</param>
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20191007.0.tar.gz/gst-libs/gst/droid/gstdroidbufferpool.c
^
|
@@ -21,7 +21,6 @@
#include <gst/gst.h>
#include "gstdroidbufferpool.h"
-#include "gstdroidmediabuffer.h"
#define gst_droid_buffer_pool_parent_class parent_class
G_DEFINE_TYPE (GstDroidBufferPool, gst_droid_buffer_pool, GST_TYPE_BUFFER_POOL);
@@ -31,11 +30,8 @@
{
GstDroidBufferPool *dpool = GST_DROID_BUFFER_POOL (pool);
- // if the allocator is set then we should keep the memory
- if (!dpool->allocator) {
- gst_buffer_remove_all_memory (buffer);
- GST_BUFFER_FLAG_UNSET (buffer, GST_BUFFER_FLAG_TAG_MEMORY);
- }
+ gst_buffer_remove_all_memory (buffer);
+ GST_BUFFER_FLAG_UNSET (buffer, GST_BUFFER_FLAG_TAG_MEMORY);
g_mutex_lock (&dpool->lock);
++dpool->num_buffers;
@@ -46,74 +42,19 @@
return GST_BUFFER_POOL_CLASS (parent_class)->reset_buffer (pool, buffer);
}
-static gboolean
-gst_droid_buffer_pool_set_config (GstBufferPool * bpool, GstStructure * config)
-{
- GstCaps *caps;
- guint size;
- GstAllocationParams params = { GST_MEMORY_FLAG_NO_SHARE, 0, 0, 0 };
- GstDroidBufferPool *pool = GST_DROID_BUFFER_POOL (bpool);
-
- if (!gst_buffer_pool_config_get_params (config, &caps, &size, NULL, NULL)) {
- GST_WARNING_OBJECT (pool, "Invalid pool configuration");
- return FALSE;
- }
- // If we have caps then we can create droid buffers
- if (caps != NULL) {
- GST_OBJECT_LOCK (pool);
-
- if (!gst_video_info_from_caps (&pool->video_info, caps)) {
- GST_OBJECT_UNLOCK (pool);
- GST_WARNING_OBJECT (pool, "Invalid video caps %" GST_PTR_FORMAT, caps);
- return FALSE;
- }
-
- pool->video_info.size = size;
-
- GST_DEBUG_OBJECT (pool, "Configured pool. caps: %" GST_PTR_FORMAT, caps);
- pool->allocator = gst_droid_media_buffer_allocator_new ();
- gst_object_ref (pool->allocator);
- gst_buffer_pool_config_set_allocator (config,
- (GstAllocator *) pool->allocator, ¶ms);
- GST_OBJECT_UNLOCK (pool);
- }
-
- return GST_BUFFER_POOL_CLASS (gst_droid_buffer_pool_parent_class)
- ->set_config (bpool, config);
-}
-
-static const gchar **
-gst_droid_buffer_pool_get_options (GstBufferPool * bpool)
-{
- static const gchar *options[] = { GST_BUFFER_POOL_OPTION_VIDEO_META, NULL };
-
- return options;
-}
-
static GstFlowReturn
-gst_droid_buffer_pool_alloc (GstBufferPool * pool, GstBuffer ** buf,
+gst_droid_buffer_pool_alloc (GstBufferPool * pool, GstBuffer ** buffer,
GstBufferPoolAcquireParams * params G_GNUC_UNUSED)
{
GstDroidBufferPool *dpool = GST_DROID_BUFFER_POOL (pool);
- GstBuffer *buffer;
- GstMemory *memory;
- buffer = gst_buffer_new ();
- if (!buffer) {
+ *buffer = gst_buffer_new ();
+ if (!*buffer) {
return GST_FLOW_ERROR;
}
- // if the allocator is set then we should create the memory too
- if (dpool->allocator) {
- memory = gst_droid_media_buffer_allocator_alloc_new (dpool->allocator,
- &dpool->video_info, buffer);
- if (!memory) {
- return GST_FLOW_ERROR;
- }
- }
g_mutex_lock (&dpool->lock);
++dpool->num_buffers;
- *buf = buffer;
GST_DEBUG_OBJECT (dpool, "num buffers: %d", dpool->num_buffers);
g_cond_signal (&dpool->cond);
g_mutex_unlock (&dpool->lock);
@@ -195,10 +136,7 @@
gst_droid_buffer_pool_finalize (GObject * object)
{
GstDroidBufferPool *pool = GST_DROID_BUFFER_POOL (object);
- if (pool->allocator) {
- gst_object_unref (pool->allocator);
- pool->allocator = 0;
- }
+
g_mutex_clear (&pool->lock);
g_cond_clear (&pool->cond);
@@ -217,15 +155,11 @@
gstbufferpool_class->reset_buffer = gst_droid_buffer_pool_reset_buffer;
gstbufferpool_class->alloc_buffer = gst_droid_buffer_pool_alloc;
gstbufferpool_class->flush_start = gst_droid_buffer_pool_flush_start;
- gstbufferpool_class->get_options = gst_droid_buffer_pool_get_options;
- gstbufferpool_class->set_config = gst_droid_buffer_pool_set_config;
}
static void
-gst_droid_buffer_pool_init (GstDroidBufferPool * object)
+gst_droid_buffer_pool_init (GstDroidBufferPool * pool G_GNUC_UNUSED)
{
- GstDroidBufferPool *pool = GST_DROID_BUFFER_POOL (object);
- pool->allocator = 0;
g_mutex_init (&pool->lock);
g_cond_init (&pool->cond);
}
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20191007.0.tar.gz/gst-libs/gst/droid/gstdroidbufferpool.h
^
|
@@ -23,7 +23,6 @@
#define __GST_DROID_BUFFER_POOL_H__
#include <gst/gstbufferpool.h>
-#include <gst/video/video-info.h>
G_BEGIN_DECLS
@@ -41,8 +40,6 @@
GMutex lock;
GCond cond;
gint num_buffers;
- GstAllocator *allocator;
- GstVideoInfo video_info;
};
struct _GstDroidBufferPoolClass
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20191007.0.tar.gz/gst-libs/gst/droid/gstdroidcodec.c
^
|
@@ -45,11 +45,13 @@
codec, GstBuffer * data, DroidMediaData * out);
static gboolean create_h265dec_codec_data_from_codec_data (GstDroidCodec *
codec, GstBuffer * data, DroidMediaData * out);
+static gboolean create_vp8vdec_codec_data_from_codec_data (GstDroidCodec *
+ codec, GstBuffer * data, DroidMediaData * out);
static gboolean create_aacdec_codec_data_from_codec_data (GstDroidCodec * codec,
GstBuffer * data, DroidMediaData * out);
static gboolean create_aacdec_codec_data_from_frame_data (GstDroidCodec * codec,
GstBuffer * frame_data, DroidMediaData * out);
-static gboolean process_h26xdec_data (GstDroidCodec * codec, GstBuffer * buffer,
+static gboolean process_h264dec_data (GstDroidCodec * codec, GstBuffer * buffer,
DroidMediaData * out);
static gboolean process_aacdec_data (GstDroidCodec * codec, GstBuffer * buffer,
DroidMediaData * out);
@@ -111,12 +113,6 @@
is_mpega, NULL, NULL, NULL, create_aacdec_codec_data_from_codec_data,
create_aacdec_codec_data_from_frame_data, process_aacdec_data},
- {GST_DROID_CODEC_DECODER_AUDIO, "audio/AMR", "audio/3gpp",
- "audio/AMR", FALSE, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
-
- {GST_DROID_CODEC_DECODER_AUDIO, "audio/AMR-WB", "audio/amr-wb",
- "audio/AMR-WB", FALSE, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
-
/* video decoders */
{GST_DROID_CODEC_DECODER_VIDEO, "video/mpeg", "video/mp4v-es",
"video/mpeg, mpegversion=4", TRUE,
@@ -126,7 +122,7 @@
{GST_DROID_CODEC_DECODER_VIDEO, "video/x-h264", "video/avc",
"video/x-h264, stream-format=avc,alignment=au", TRUE,
is_h264_dec, NULL, NULL, NULL,
- create_h264dec_codec_data_from_codec_data, NULL, process_h26xdec_data},
+ create_h264dec_codec_data_from_codec_data, NULL, process_h264dec_data},
{GST_DROID_CODEC_DECODER_VIDEO, "video/x-h263", "video/3gpp",
"video/x-h263", TRUE, NULL,
@@ -136,16 +132,16 @@
"video/x-vp8", TRUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
{GST_DROID_CODEC_DECODER_VIDEO, "video/x-vp9", "video/x-vnd.on2.vp9",
- "video/x-vp9", TRUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
+ "video/x-vp9", FALSE, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
{GST_DROID_CODEC_DECODER_VIDEO, "video/mpeg", "video/mpeg2",
- "video/mpeg, mpegversion=2", TRUE,
+ "video/mpeg, mpegversion=2", FALSE,
NULL, NULL, NULL, NULL,
create_mpeg2vdec_codec_data_from_codec_data, NULL, NULL},
{GST_DROID_CODEC_DECODER_VIDEO, "video/x-h265", "video/hevc",
"video/x-h265", FALSE, NULL, NULL, NULL, NULL,
- create_h265dec_codec_data_from_codec_data, NULL, process_h26xdec_data},
+ create_h265dec_codec_data_from_codec_data, NULL, process_h264dec_data},
/* audio encoders */
{GST_DROID_CODEC_ENCODER_AUDIO, "audio/mpeg", "audio/mp4a-latm",
@@ -237,20 +233,6 @@
continue;
}
- /* Verify that video codec is supported before enabling it */
- if (type == GST_DROID_CODEC_DECODER_VIDEO
- || type == GST_DROID_CODEC_ENCODER_VIDEO) {
- DroidMediaCodecMetaData md;
- md.type = codecs[x].droid;
- md.flags = DROID_MEDIA_CODEC_HW_ONLY;
- if (!droid_media_codec_is_supported (&md,
- type == GST_DROID_CODEC_ENCODER_VIDEO)) {
- GST_INFO ("No hardware support found for %s, disabling codec",
- codecs[x].droid);
- continue;
- }
- }
-
s = gst_structure_new_from_string (codecs[x].caps);
caps = gst_caps_merge_structure (caps, s);
}
@@ -936,7 +918,7 @@
}
static gboolean
-process_h26xdec_data (GstDroidCodec * codec, GstBuffer * buffer,
+process_h264dec_data (GstDroidCodec * codec, GstBuffer * buffer,
DroidMediaData * out)
{
GstMapInfo info;
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20191007.0.tar.gz/gst-libs/gst/droid/gstdroidmediabuffer.c
^
|
@@ -135,7 +135,7 @@
constants.HAL_PIXEL_FORMAT_YV12;
gst_droid_media_buffer_formats[5].gst_format = GST_VIDEO_FORMAT_YV12;
gst_droid_media_buffer_formats[5].bytes_per_pixel = 1;
- gst_droid_media_buffer_formats[5].h_align = 16;
+ gst_droid_media_buffer_formats[5].h_align = 1;
gst_droid_media_buffer_formats[5].v_align = 1;
gst_droid_media_buffer_formats[6].hal_format =
@@ -244,7 +244,7 @@
static GstDroidMediaBufferMemory *
gst_droid_media_buffer_allocator_alloc_from_buffer (GstAllocator * allocator,
DroidMediaBuffer * buffer, int format_index, gsize width, gsize height,
- gsize stride, gsize size)
+ gsize stride)
{
GstDroidMediaBufferMemory *mem = g_slice_new0 (GstDroidMediaBufferMemory);
GstFormat format;
@@ -261,8 +261,6 @@
} else {
format = gst_droid_media_buffer_formats[format_index].gst_format;
if (gst_droid_media_buffer_formats[format_index].bytes_per_pixel != 0) {
- stride =
- stride * gst_droid_media_buffer_formats[format_index].bytes_per_pixel;
padded_width =
ALIGN_SIZE (stride,
gst_droid_media_buffer_formats[format_index].h_align) /
@@ -277,25 +275,11 @@
padded_height);
mem->video_info.width = width;
mem->video_info.height = height;
- mem->video_info.size = size;
-
- // Android YV12 requires alignment of the UV stride too.
- // So we need to reset the gst UV strides and offsets.
- if (gst_droid_media_buffer_formats[format_index].gst_format ==
- GST_VIDEO_FORMAT_YV12) {
- gsize uvStride = ALIGN_SIZE (stride / 2,
- gst_droid_media_buffer_formats[format_index].h_align);
- mem->video_info.stride[1] = uvStride;
- mem->video_info.stride[2] = uvStride;
- mem->video_info.offset[1] = stride * padded_height *
- gst_droid_media_buffer_formats[format_index].bytes_per_pixel;
- mem->video_info.offset[2] =
- mem->video_info.offset[1] + uvStride * padded_height / 2;
- }
gst_memory_init (GST_MEMORY_CAST (mem),
- GST_MEMORY_FLAG_NO_SHARE, GST_ALLOCATOR (allocator), NULL,
- mem->video_info.size, 0, 0, mem->video_info.size);
+ GST_MEMORY_FLAG_NO_SHARE, allocator, NULL, mem->video_info.size, 0, 0,
+ mem->video_info.size);
+
return mem;
}
@@ -325,7 +309,7 @@
format_index = gst_droid_media_buffer_index_of_hal_format (info.format);
mem = gst_droid_media_buffer_allocator_alloc_from_buffer (allocator, buffer,
- format_index, info.width, info.height, info.stride, 1);
+ format_index, info.width, info.height, info.stride);
GST_DEBUG_OBJECT (allocator, "alloc %p", mem);
@@ -333,14 +317,12 @@
}
GstMemory *
-gst_droid_media_buffer_allocator_alloc_new (GstAllocator * allocator,
- GstVideoInfo * info, GstBuffer * buffer)
+gst_droid_media_buffer_allocator_alloc_from_data (GstAllocator * allocator,
+ GstVideoInfo * info, DroidMediaData * data, DroidMediaBufferCallbacks * cb)
{
GstDroidMediaBufferMemory *mem;
- DroidMediaBuffer *dbuf;
+ DroidMediaBuffer *buffer;
DroidMediaBufferInfo droid_info;
- DroidMediaBufferCallbacks cb;
- GstVideoMeta *video_meta;
int format_index;
if (!GST_IS_DROID_MEDIA_BUFFER_ALLOCATOR (allocator)) {
@@ -358,33 +340,21 @@
gst_video_format_to_string (info->finfo->format));
return NULL;
}
- GST_WARNING_OBJECT (allocator,
- "GStreamer format %s", gst_video_format_to_string (info->finfo->format));
- cb.ref = (DroidMediaCallback) gst_buffer_ref;
- cb.unref = (DroidMediaCallback) gst_buffer_unref;
- cb.data = buffer;
- dbuf =
- droid_media_buffer_create (info->width, info->height,
- gst_droid_media_buffer_formats[format_index].hal_format, &cb);
- if (!dbuf) {
+ buffer =
+ droid_media_buffer_create_from_raw_data (info->width, info->height,
+ GST_VIDEO_INFO_COMP_STRIDE (info, 0),
+ GST_VIDEO_INFO_COMP_STRIDE (info, 1),
+ gst_droid_media_buffer_formats[format_index].hal_format, data, cb);
+ if (!buffer) {
GST_ERROR_OBJECT (allocator, "failed to acquire media buffer");
return NULL;
}
- droid_media_buffer_get_info (dbuf, &droid_info);
- mem =
- gst_droid_media_buffer_allocator_alloc_from_buffer (allocator, dbuf,
- format_index, info->width, info->height, droid_info.stride, info->size);
-
- gst_buffer_append_memory (buffer, (GstMemory *) mem);
-
- video_meta = gst_buffer_add_video_meta_full (buffer,
- GST_VIDEO_FRAME_FLAG_NONE, mem->video_info.finfo->format,
- mem->video_info.width, mem->video_info.height,
- mem->video_info.finfo->n_planes, mem->video_info.offset,
- mem->video_info.stride);
- GST_META_FLAG_SET ((GstMeta *) video_meta, GST_META_FLAG_POOLED);
+ droid_media_buffer_get_info (buffer, &droid_info);
+
+ mem = gst_droid_media_buffer_allocator_alloc_from_buffer (allocator, buffer,
+ format_index, info->width, info->height, droid_info.stride);
GST_DEBUG_OBJECT (allocator, "alloc %p", mem);
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20191007.0.tar.gz/gst-libs/gst/droid/gstdroidmediabuffer.h
^
|
@@ -36,8 +36,10 @@
GstMemory * gst_droid_media_buffer_allocator_alloc (GstAllocator * allocator,
DroidMediaBufferQueue *queue,
DroidMediaBufferCallbacks *cb);
-GstMemory * gst_droid_media_buffer_allocator_alloc_new (GstAllocator * allocator,
- GstVideoInfo * info, GstBuffer * buffer);
+GstMemory * gst_droid_media_buffer_allocator_alloc_from_data (GstAllocator * allocator,
+ GstVideoInfo * info,
+ DroidMediaData * data,
+ DroidMediaBufferCallbacks *cb);
DroidMediaBuffer * gst_droid_media_buffer_memory_get_buffer (GstMemory * mem);
gboolean gst_is_droid_media_buffer_memory (GstMemory * mem);
|
[-]
[+]
|
Changed |
_service:tar_git:gstreamer1.0-droid-0.20191007.0.tar.gz/gst/droideglsink/gstdroideglsink.c
^
|
@@ -27,7 +27,6 @@
#include <gst/video/video.h>
#include <gst/interfaces/nemovideotexture.h>
#include "gst/droid/gstdroidmediabuffer.h"
-#include "gst/droid/gstdroidbufferpool.h"
GST_DEBUG_CATEGORY_EXTERN (gst_droid_eglsink_debug);
#define GST_CAT_DEFAULT gst_droid_eglsink_debug
@@ -47,7 +46,7 @@
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE_WITH_FEATURES
(GST_CAPS_FEATURE_MEMORY_DROID_MEDIA_BUFFER,
GST_DROID_MEDIA_BUFFER_MEMORY_VIDEO_FORMATS) "; "
- GST_VIDEO_CAPS_MAKE (GST_DROID_MEDIA_BUFFER_MEMORY_VIDEO_FORMATS)));
+ GST_VIDEO_CAPS_MAKE ("{YV12, NV21}")));
enum
{
@@ -124,7 +123,7 @@
if (!gst_video_info_from_caps (&info, caps)) {
GST_ELEMENT_ERROR (sink, STREAM, FORMAT, (NULL),
- ("Could not locate image format from caps %" GST_PTR_FORMAT, caps));
+ ("ould not locate image format from caps %" GST_PTR_FORMAT, caps));
return FALSE;
}
@@ -137,52 +136,6 @@
return TRUE;
}
-static gboolean
-gst_droideglsink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
-{
- GstDroidEglSink *sink = GST_DROIDEGLSINK (bsink);
- GstBufferPool *pool;
- GstCaps *caps;
- guint size;
- gboolean need_pool;
- GstStructure *config;
- GstVideoInfo video_info;
-
- gst_query_parse_allocation (query, &caps, &need_pool);
-
- if (!caps) {
- GST_ERROR_OBJECT (sink, "No query caps");
- return FALSE;
- }
-
- if (!gst_video_info_from_caps (&video_info, caps)) {
- GST_ERROR_OBJECT (sink, "Unable to get video caps");
- return FALSE;
- }
-
- if (need_pool) {
- pool = gst_droid_buffer_pool_new ();
- size = video_info.finfo->format == GST_VIDEO_FORMAT_ENCODED
- ? 1 : video_info.size;
-
- config = gst_buffer_pool_get_config (pool);
- gst_buffer_pool_config_set_params (config, caps, size, 2, 0);
- if (!gst_buffer_pool_set_config (pool, config)) {
- GST_ERROR_OBJECT (sink, "Failed to set buffer pool configuration");
- gst_object_unref (pool);
- return FALSE;
- }
- gst_query_add_allocation_pool (query, pool, size, 0, 2);
- gst_object_unref (pool);
- }
-
- gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL);
-
- GST_DEBUG_OBJECT (sink, "proposed allocation");
-
- return TRUE;
-}
-
static void
gst_droideglsink_get_times (GstBaseSink * bsink, GstBuffer * buf,
GstClockTime * start, GstClockTime * end)
@@ -444,8 +397,7 @@
gstbasesink_class->start = GST_DEBUG_FUNCPTR (gst_droideglsink_start);
gstbasesink_class->stop = GST_DEBUG_FUNCPTR (gst_droideglsink_stop);
gstbasesink_class->event = GST_DEBUG_FUNCPTR (gst_droideglsink_event);
- gstbasesink_class->propose_allocation =
- GST_DEBUG_FUNCPTR (gst_droideglsink_propose_allocation);
+
videosink_class->show_frame = GST_DEBUG_FUNCPTR (gst_droideglsink_show_frame);
g_object_class_override_property (gobject_class, PROP_EGL_DISPLAY,
@@ -475,6 +427,79 @@
return NULL;
}
+static GstBuffer *
+gst_droideglsink_copy_buffer (GstDroidEglSink * sink, GstBuffer * buffer)
+{
+ GstMapInfo info;
+ GstVideoInfo format;
+ GstBuffer *buff = gst_buffer_new ();
+ GstMemory *mem = NULL;
+ GstCaps *caps = NULL;
+ DroidMediaData data;
+ gboolean unmap = FALSE;
+ DroidMediaBufferCallbacks cb;
+
+ GST_DEBUG_OBJECT (sink, "copy buffer");
+
+ if (!gst_pad_has_current_caps (GST_BASE_SINK_PAD (sink))) {
+ goto free_and_out;
+ }
+
+ if (!gst_buffer_copy_into (buff, buffer,
+ GST_BUFFER_COPY_FLAGS |
+ GST_BUFFER_COPY_TIMESTAMPS | GST_BUFFER_COPY_META, 0, -1)) {
+ goto free_and_out;
+ }
+
+ if (!gst_buffer_map (buffer, &info, GST_MAP_READ)) {
+ goto free_and_out;
+ }
+
+ unmap = TRUE;
+
+ caps = gst_pad_get_current_caps (GST_BASE_SINK_PAD (sink));
+ if (!gst_video_info_from_caps (&format, caps)) {
+ goto free_and_out;
+ }
+
+ cb.ref = (DroidMediaCallback) gst_buffer_ref;
+ cb.unref = (DroidMediaCallback) gst_buffer_unref;
+ cb.data = buff;
+
+ data.size = info.size;
+ data.data = info.data;
+
+ mem = gst_droid_media_buffer_allocator_alloc_from_data (sink->allocator,
+ &format, &data, &cb);
+
+ if (!mem) {
+ goto free_and_out;
+ }
+
+ gst_buffer_append_memory (buff, mem);
+ gst_buffer_unmap (buffer, &info);
+ gst_caps_unref (caps);
+
+ return buff;
+
+free_and_out:
+ if (unmap) {
+ gst_buffer_unmap (buffer, &info);
+ }
+
+ gst_buffer_unref (buff);
+
+ if (mem) {
+ gst_memory_unref (mem);
+ }
+
+ if (caps) {
+ gst_caps_unref (caps);
+ }
+
+ return NULL;
+}
+
static gboolean
gst_droideglsink_populate_egl_proc (GstDroidEglSink * sink)
{
@@ -549,14 +574,14 @@
mem =
gst_droideglsink_get_droid_media_buffer_memory (sink, sink->last_buffer);
- if (!mem) {
- ret = FALSE;
- GST_WARNING_OBJECT (sink, "no droidmedia buffer available");
- goto unlock_and_out;
+ if (mem) {
+ sink->acquired_buffer = gst_buffer_ref (sink->last_buffer);
+ } else {
+ /* Construct a new buffer */
+ sink->acquired_buffer =
+ gst_droideglsink_copy_buffer (sink, sink->last_buffer);
}
- sink->acquired_buffer = gst_buffer_ref (sink->last_buffer);
-
if (!sink->acquired_buffer) {
ret = FALSE;
GST_INFO_OBJECT (sink, "failed to acquire a buffer");
|