[1.2.3] Refactor MediaTransporterDisplay to use 'template method pattern' with a... 79/316979/10
authorGilbok Lee <gilbok.lee@samsung.com>
Mon, 2 Sep 2024 09:05:25 +0000 (18:05 +0900)
committerGilbok Lee <gilbok.lee@samsung.com>
Fri, 6 Sep 2024 03:34:29 +0000 (12:34 +0900)
- Two new subclasses, MediaTransporterDisplayOverlay and MediaTransporterDisplayEvas,
  are introduced to handle specific display types.
- The MediaTransporterDisplayFactory class has been added to manage
  the creation of MediaTransporterDisplay instances based on the display type
  provided as an argument.

Change-Id: I7d33f2671a76daeb33e0003799b1df7fa2dd6038

16 files changed:
include/MediaTransporterDisplay.h
include/MediaTransporterDisplayEvas.h [new file with mode: 0644]
include/MediaTransporterDisplayFactory.h [new file with mode: 0644]
include/MediaTransporterDisplayOverlay.h [new file with mode: 0644]
packaging/capi-media-transporter.spec
src/MediaSourceAudio.cpp
src/MediaSourceBinFactory.cpp
src/MediaTransporter.cpp
src/MediaTransporterDisplay.cpp
src/MediaTransporterDisplayEvas.cpp [new file with mode: 0644]
src/MediaTransporterDisplayFactory.cpp [new file with mode: 0644]
src/MediaTransporterDisplayOverlay.cpp [new file with mode: 0644]
src/MediaTransporterFactory.cpp
src/MediaTransporterParam.cpp
src/MediaTransporterReceiver.cpp
unittest/src/ut_es_reader.cpp

index 5b62473ece89b91e2f26aaf0bca8475ac4b889a2..8e12ec8fc7e6b196bb55e6a4d0d7398053f5db8f 100644 (file)
@@ -22,7 +22,6 @@
 #include <gst/gst.h>
 
 #include "MediaTransporter.h"
-#include "MediaTransporterObserver.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -36,7 +35,7 @@ public:
        MediaTransporterDisplay(mtprDisplayType type, void *surface);
        ~MediaTransporterDisplay();
 
-       GstElement* videoSink();
+       virtual GstElement* createVideoSink() = 0;
 
        mtprDisplayType getType() { return _type; };
 
@@ -50,9 +49,9 @@ public:
 
        mm_display_interface_h getMmDisplayHandle() { std::lock_guard<std::mutex> mutex(_mutex); return _mmDisplay; }
 
-private:
-       void applyVisibleProperty();
-       void applyModeProperty();
+protected:
+       virtual void applyVisibleProperty() = 0;
+       virtual void applyModeProperty() = 0;
 
        mtprDisplayType _type;
        void* _surface;
diff --git a/include/MediaTransporterDisplayEvas.h b/include/MediaTransporterDisplayEvas.h
new file mode 100644 (file)
index 0000000..f768797
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#ifndef __TIZEN_MEDIA_TRANSPORTER_DISPLAY_EVAS_H__
+#define __TIZEN_MEDIA_TRANSPORTER_DISPLAY_EVAS_H__
+
+#include "MediaTransporter.h"
+#include "MediaTransporterDisplay.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+namespace tizen_media_transporter {
+
+class MediaTransporterDisplayEvas : public MediaTransporterDisplay {
+public:
+       MediaTransporterDisplayEvas(void *surface)
+               : MediaTransporterDisplay(mtprDisplayType::MTPR_DISPLAY_TYPE_EVAS, surface) {};
+       ~MediaTransporterDisplayEvas() = default;
+
+       GstElement* createVideoSink() override;
+
+private:
+       void applyVisibleProperty() override;
+       void applyModeProperty() override;
+};
+
+} // namespace tizen_media_transporter
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __TIZEN_MEDIA_TRANSPORTER_DISPLAY_EVAS_H__ */
diff --git a/include/MediaTransporterDisplayFactory.h b/include/MediaTransporterDisplayFactory.h
new file mode 100644 (file)
index 0000000..f13e13f
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#ifndef __TIZEN_MEDIA_TRANSPORTER_DISPLAY_FACTORY_H__
+#define __TIZEN_MEDIA_TRANSPORTER_DISPLAY_FACTORY_H__
+
+#include "MediaTransporter.h"
+#include "MediaTransporterDisplay.h"
+#include "MediaTransporterException.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+namespace tizen_media_transporter {
+
+class MediaTransporterDisplayFactory
+{
+public:
+       static MediaTransporterDisplay* create(mtprDisplayType type, void *surface);
+
+};
+
+} // namespace tizen_media_transporter
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __TIZEN_MEDIA_TRANSPORTER_DISPLAY_FACTORY_H__ */
diff --git a/include/MediaTransporterDisplayOverlay.h b/include/MediaTransporterDisplayOverlay.h
new file mode 100644 (file)
index 0000000..265d580
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#ifndef __TIZEN_MEDIA_TRANSPORTER_DISPLAY_OVERAY_H__
+#define __TIZEN_MEDIA_TRANSPORTER_DISPLAY_OVERAY_H__
+
+#include "MediaTransporter.h"
+#include "MediaTransporterDisplay.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+namespace tizen_media_transporter {
+
+class MediaTransporterDisplayOverlay : public MediaTransporterDisplay {
+public:
+       MediaTransporterDisplayOverlay(void *surface)
+               : MediaTransporterDisplay(mtprDisplayType::MTPR_DISPLAY_TYPE_OVERLAY, surface) {};
+       ~MediaTransporterDisplayOverlay() = default;
+
+       GstElement* createVideoSink() override;
+
+private:
+       void applyVisibleProperty() override;
+       void applyModeProperty() override;
+};
+
+} // namespace tizen_media_transporter
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __TIZEN_MEDIA_TRANSPORTER_DISPLAY_OVERAY_H__ */
index 91253488cc148a790e71bdeb38b0d6c1f10c1f2c..4c1d738d4fce3d73460409477977c92185c018cd 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-transporter
 Summary:    A Media Transporter library in Tizen Native API
-Version:    1.2.2
+Version:    1.2.3
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index 22b95d0a0d41fd0f532d9639e9cba05892e6ad06..a72bebac7cb6c0da9e1ecf0643d3eb13c1af6e9d 100644 (file)
@@ -136,8 +136,7 @@ int MediaSourceAudio::getSourceAudioChannels()
 
 void MediaSourceAudio::setSourceAudioFormat(mtprSourceAudioFormat format)
 {
-       switch (format)
-       {
+       switch (format) {
        case MTPR_SOURCE_AUDIO_FORMAT_S16LE:
                _audioInfo.format = "S16LE";
                break;
index e682a6f1d0f044f4b0617e7bcb9c37aedcaa76f0..7e58d086f448a40bca711b6ed4e1d51ac451ca89 100644 (file)
@@ -24,8 +24,7 @@ using namespace tizen_media_transporter;
 
 IMediaSourceBin* MediaSourceBinFactory::create(mtprSourceType type)
 {
-       switch (type)
-       {
+       switch (type) {
        case MTPR_SOURCE_TYPE_VIDEOTEST:
                return static_cast<IMediaSourceBin*>(new MediaSourceBinVideoTest());
        case MTPR_SOURCE_TYPE_AUDIOTEST:
index 5ac3b00e95004d585112e516452b3d4f26a8a5f2..3c1651e0d92f9474926f11dd4d6a1d2ab7ae8719 100644 (file)
@@ -4,6 +4,7 @@
 #include "MediaTransporterLog.h"
 #include "MediaTransporterFactory.h"
 #include "MediaSourceBinFactory.h"
+#include "MediaTransporterDisplayFactory.h"
 #include "MediaSourceBinBase.h"
 #include "MediaSourceAudio.h"
 #include "MediaSourceVideo.h"
@@ -934,7 +935,8 @@ int mtpr_set_display(mtpr_h mtpr, mtpr_display_type_e type, mtpr_display_h displ
        RET_VAL_IF(!receiver, MTPR_ERROR_INVALID_OPERATION, "only receiver support this api!!!");
 
        try {
-               handle->display = std::make_shared<MediaTransporterDisplay>(type, display);
+               handle->display = std::shared_ptr<MediaTransporterDisplay>(
+                                                       MediaTransporterDisplayFactory::create(static_cast<mtprDisplayType>(type), display));
                receiver->setDisplay(handle->display);
        } catch (const MediaTransporterException& e) {
                LOG_ERROR("Failed to set display!!! : %s", e.what());
index 2030833a4b486989d630f8809c3940b39ddd70d1..4dbe8ba483fa5dfbee5ac01aa5f0d24b76cfc43e 100644 (file)
@@ -24,8 +24,6 @@
 #include "MediaTransporterDisplay.h"
 #include "MediaTransporterException.h"
 #include "MediaTransporterLog.h"
-#include "MediaTransporterParseIni.h"
-#include "MediaTransporterGst.h"
 
 using namespace tizen_media_transporter;
 
@@ -57,52 +55,6 @@ MediaTransporterDisplay::~MediaTransporterDisplay()
        LOG_DEBUG("dtor: %p", this);
 }
 
-GstElement* MediaTransporterDisplay::videoSink()
-{
-       std::lock_guard<std::mutex> mutex(_mutex);
-       mm_display_type_e displayType = MM_DISPLAY_TYPE_NONE;
-       try {
-               std::string videoSinkName;
-
-               switch (_type) {
-               case MTPR_DISPLAY_TYPE_OVERLAY:
-                       displayType = MM_DISPLAY_TYPE_OVERLAY;
-                       videoSinkName = MediaTransporterIni::get().renderingSink().videoSinkElement;
-                       LOG_INFO("it's OVERLAY type");
-                       break;
-               case MTPR_DISPLAY_TYPE_EVAS:
-                       LOG_INFO("it's EVAS type");
-                       displayType = MM_DISPLAY_TYPE_EVAS;
-                       videoSinkName = gst::DEFAULT_ELEMENT_FAKESINK;
-                       break;
-               default:
-                       LOG_ERROR_IF_REACHED("type(%d)", _type);
-                       throw MediaTransporterException(MTPR_ERROR_INVALID_PARAMETER, "_display is NULL");
-               }
-
-               _sinkElement = gst::_createElement(videoSinkName);
-
-               int overlaySurfaceId = -1;
-               if (mm_display_interface_set_display_mainloop_sync(_mmDisplay, displayType, _surface, &overlaySurfaceId) != MM_ERROR_NONE)
-                       throw MediaTransporterException(MTPR_ERROR_INVALID_OPERATION, "failed to mm_display_interface_set_display_mainloop_sync()");
-
-               applyModeProperty();
-               applyVisibleProperty();
-
-               LOG_INFO("surface[%p], got overlaySurfaceId[%d]", _surface, overlaySurfaceId);
-               if (_type == MTPR_DISPLAY_TYPE_OVERLAY)
-                       gst_video_overlay_set_wl_window_wl_surface_id(GST_VIDEO_OVERLAY(_sinkElement), overlaySurfaceId);
-
-               return GST_ELEMENT(gst_object_ref(_sinkElement));
-       } catch (const MediaTransporterException& e) {
-               if (_sinkElement) {
-                       gst_object_unref(_sinkElement);
-                       _sinkElement = nullptr;
-               }
-               throw;
-       }
-}
-
 void MediaTransporterDisplay::setVisible(bool visible)
 {
        std::lock_guard<std::mutex> mutex(_mutex);
@@ -122,30 +74,3 @@ void MediaTransporterDisplay::setMode(mtprDisplayMode mode)
        if (_sinkElement)
                applyModeProperty();
 }
-
-void MediaTransporterDisplay::applyVisibleProperty()
-{
-       if (_type == MTPR_DISPLAY_TYPE_OVERLAY) {
-               if (g_object_class_find_property(G_OBJECT_GET_CLASS(G_OBJECT(_sinkElement)), "visible"))
-                       g_object_set(G_OBJECT(_sinkElement),
-                                       "visible", _visible, NULL);
-       } else {
-               int ret = mm_display_interface_evas_set_visible(_mmDisplay, _visible);
-               if (ret != MM_ERROR_NONE)
-                       LOG_ERROR("mm_display_interface_evas_set_visible failed 0x%x", ret);
-       }
-}
-
-void MediaTransporterDisplay::applyModeProperty()
-{
-       if (_type == MTPR_DISPLAY_TYPE_OVERLAY) {
-               if (g_object_class_find_property(G_OBJECT_GET_CLASS(G_OBJECT(_sinkElement)), "display-geometry-method"))
-                       g_object_set(G_OBJECT(_sinkElement),
-                                       "display-geometry-method", (gint)_mode, /* 0: letter box, 1: origin size, 2: full screen */
-                                       NULL);
-       } else {
-               int ret = mm_display_interface_evas_set_mode(_mmDisplay, static_cast<int>(_mode));
-               if (ret != MM_ERROR_NONE)
-                       LOG_ERROR("mm_display_interface_evas_set_mode failed 0x%x", ret);
-       }
-}
\ No newline at end of file
diff --git a/src/MediaTransporterDisplayEvas.cpp b/src/MediaTransporterDisplayEvas.cpp
new file mode 100644 (file)
index 0000000..7ed32e7
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <iostream>
+#include <string>
+#include <algorithm>
+#include <mm_error.h>
+
+#include "MediaTransporter.h"
+#include "MediaTransporterDisplayEvas.h"
+#include "MediaTransporterException.h"
+#include "MediaTransporterLog.h"
+#include "MediaTransporterGst.h"
+
+using namespace tizen_media_transporter;
+
+GstElement* MediaTransporterDisplayEvas::createVideoSink()
+{
+       std::lock_guard<std::mutex> mutex(_mutex);
+       try {
+               _sinkElement = gst::_createElement(gst::DEFAULT_ELEMENT_FAKESINK);
+
+               if (mm_display_interface_set_display_mainloop_sync(_mmDisplay, MM_DISPLAY_TYPE_EVAS, _surface, nullptr) != MM_ERROR_NONE)
+                       throw MediaTransporterException(MTPR_ERROR_INVALID_OPERATION, "failed to mm_display_interface_set_display_mainloop_sync()");
+
+               applyModeProperty();
+               applyVisibleProperty();
+
+               LOG_INFO("surface[%p]", _surface);
+               return GST_ELEMENT(gst_object_ref(_sinkElement));
+       } catch (const MediaTransporterException& e) {
+               if (_sinkElement) {
+                       gst_object_unref(_sinkElement);
+                       _sinkElement = nullptr;
+               }
+               throw;
+       }
+}
+
+void MediaTransporterDisplayEvas::applyVisibleProperty()
+{
+       int ret = mm_display_interface_evas_set_visible(_mmDisplay, _visible);
+       if (ret != MM_ERROR_NONE)
+               LOG_ERROR("mm_display_interface_evas_set_visible failed 0x%x", ret);
+}
+
+void MediaTransporterDisplayEvas::applyModeProperty()
+{
+       int ret = mm_display_interface_evas_set_mode(_mmDisplay, static_cast<int>(_mode));
+       if (ret != MM_ERROR_NONE)
+               LOG_ERROR("mm_display_interface_evas_set_mode failed 0x%x", ret);
+}
diff --git a/src/MediaTransporterDisplayFactory.cpp b/src/MediaTransporterDisplayFactory.cpp
new file mode 100644 (file)
index 0000000..e49f8e8
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include "MediaTransporter.h"
+#include "MediaTransporterLog.h"
+#include "MediaTransporterDisplayOverlay.h"
+#include "MediaTransporterDisplayEvas.h"
+#include "MediaTransporterDisplayFactory.h"
+#include "MediaTransporterException.h"
+
+using namespace tizen_media_transporter;
+
+MediaTransporterDisplay* MediaTransporterDisplayFactory::create(mtprDisplayType type, void *surface)
+{
+       try {
+               switch (type) {
+               case MTPR_DISPLAY_TYPE_OVERLAY:
+                       return new MediaTransporterDisplayOverlay(surface);
+               case MTPR_DISPLAY_TYPE_EVAS:
+                       return new MediaTransporterDisplayEvas(surface);
+               default:
+                       throw MediaTransporterException(MTPR_ERROR_INVALID_PARAMETER, "Invalid display type");
+               }
+       } catch (const MediaTransporterException& e) {
+               LOG_ERROR("%s", e.what());
+               throw;
+       }
+}
diff --git a/src/MediaTransporterDisplayOverlay.cpp b/src/MediaTransporterDisplayOverlay.cpp
new file mode 100644 (file)
index 0000000..f81fe83
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <iostream>
+#include <string>
+#include <algorithm>
+#include <mm_error.h>
+#include <gst/video/videooverlay.h>
+
+#include "MediaTransporter.h"
+#include "MediaTransporterDisplayOverlay.h"
+#include "MediaTransporterException.h"
+#include "MediaTransporterLog.h"
+#include "MediaTransporterParseIni.h"
+#include "MediaTransporterGst.h"
+
+using namespace tizen_media_transporter;
+
+GstElement* MediaTransporterDisplayOverlay::createVideoSink()
+{
+       std::lock_guard<std::mutex> mutex(_mutex);
+       try {
+               _sinkElement = gst::_createElement(MediaTransporterIni::get().renderingSink().videoSinkElement);
+
+               int overlaySurfaceId = -1;
+               if (mm_display_interface_set_display_mainloop_sync(_mmDisplay, MM_DISPLAY_TYPE_OVERLAY, _surface, &overlaySurfaceId) != MM_ERROR_NONE)
+                       throw MediaTransporterException(MTPR_ERROR_INVALID_OPERATION, "failed to mm_display_interface_set_display_mainloop_sync()");
+
+               applyModeProperty();
+               applyVisibleProperty();
+
+               LOG_INFO("surface[%p], got overlaySurfaceId[%d]", _surface, overlaySurfaceId);
+               gst_video_overlay_set_wl_window_wl_surface_id(GST_VIDEO_OVERLAY(_sinkElement), overlaySurfaceId);
+
+               return GST_ELEMENT(gst_object_ref(_sinkElement));
+       } catch (const MediaTransporterException& e) {
+               if (_sinkElement) {
+                       gst_object_unref(_sinkElement);
+                       _sinkElement = nullptr;
+               }
+               throw;
+       }
+}
+
+void MediaTransporterDisplayOverlay::applyVisibleProperty()
+{
+       if (g_object_class_find_property(G_OBJECT_GET_CLASS(G_OBJECT(_sinkElement)), "visible"))
+               g_object_set(G_OBJECT(_sinkElement),
+                               "visible", _visible, NULL);
+}
+
+void MediaTransporterDisplayOverlay::applyModeProperty()
+{
+       if (g_object_class_find_property(G_OBJECT_GET_CLASS(G_OBJECT(_sinkElement)), "display-geometry-method"))
+               g_object_set(G_OBJECT(_sinkElement),
+                               "display-geometry-method", (gint)_mode, /* 0: letter box, 1: origin size, 2: full screen */
+                               NULL);
+}
index 485341e8bfc64b13ca0be8bef954b5a47202b173..b8e24f876bbdf997169a068f4ffb4c71e11cfa48 100644 (file)
@@ -28,8 +28,7 @@ using namespace tizen_media_transporter;
 
 MediaTransporterBase* MediaTransporterFactory::create(mtprConnectionType type)
 {
-       switch (type)
-       {
+       switch (type) {
        case MTPR_CONNECTION_TYPE_RIST_SENDER:
                return static_cast<MediaTransporterBase*>(new MediaTransporterSenderRist());
        case MTPR_CONNECTION_TYPE_RIST_RECEIVER:
index 964425a266b5d75c0c0784fc7b8aafba97303692..919800b1ffc3402fbe2d7dca23d443318f6f76d9 100644 (file)
@@ -30,8 +30,7 @@ constexpr size_t SRT_MAX_PASSPHRASE = 79;
 
 bool param::srt::_isValidKeyLength(int keyLen)
 {
-       switch (keyLen)
-       {
+       switch (keyLen) {
        case MTPR_CONNECTION_SRT_NO_KEY:
        case MTPR_CONNECTION_SRT_KEY_LEN_16:
        case MTPR_CONNECTION_SRT_KEY_LEN_24:
index c5bbd8d9c451a3cb3db092d381f44b46b70e98f4..8f9ef4c0f81b82631721833ba955434a3c4d693a 100644 (file)
@@ -525,7 +525,7 @@ void MediaTransporterReceiver::_buildVideoRenderingSink(gst::GstElements& elemen
                        _resourceManager->acquire(RES_TYPE_VIDEO_OVERLAY);
                converter = gst::_createElement(gst::DEFAULT_ELEMENT_VIDEOCONVERT);
                elements.push_back(converter);
-               sink = _display->videoSink();
+               sink = _display->createVideoSink();
                elements.push_back(sink);
        } catch (const MediaTransporterException& e) {
                if (converter) {
index 32121d6ca051311d8352fccbb2fa405c5c8bfa02..44b25f38b2975415aa056fadd3d1406880649aa7 100644 (file)
@@ -118,8 +118,7 @@ bool EsStreamReader::readNextPacket(media_packet_h* outPacket)
 
        char* tmp = new char[1000000];
 
-       switch (_type)
-       {
+       switch (_type) {
        case MEDIA_TYPE_ENCODED_VIDEO:
                size = videobytestream2nalunit(tmp);
                ptsOffset = ES_DEFAULT_VIDEO_PTS_OFFSET;