-Dbuilding_for_tizen_mobile=0
-Dbuilding_for_tizen_tv=0
-Dclang=${USE_CLANG}
- -Dtizen_multimedia_use_capi_for_me=0
-Dtizen_multimedia_support=1
-Dwerror=
-Duse_wayland=0
COMMON_GYP_PARAMETERS+="-Dtizen_multimedia_support=1
"
elif [ "$tizen_version" == "2.4" -a "$target" == "tv" ]; then
- COMMON_GYP_PARAMETERS+="-Dtizen_multimedia_support=0
+ COMMON_GYP_PARAMETERS+="-Dtizen_multimedia_support=1
"
else
COMMON_GYP_PARAMETERS+="-Dtizen_multimedia_support=0
'variables': {
'external_content_common_deps': [
'<(DEPTH)/tizen_src/build/system.gyp:capi-appfw-application',
- '<(DEPTH)/tizen_src/build/system.gyp:gstreamer',
'<(DEPTH)/tizen_src/build/system.gyp:tts',
'<(DEPTH)/build/linux/system.gyp:fontconfig',
],
'<(DEPTH)/tizen_src/build/system.gyp:efl-extension',
'<(DEPTH)/tizen_src/chromium_impl/efl/efl.gyp:window-factory',
'<(DEPTH)/tizen_src/chromium_impl/edje_resources/edje_resources.gyp:edje_resources_efl',
- '<(DEPTH)/tizen_src/build/system.gyp:gstreamer',
'<(DEPTH)/tizen_src/build/system.gyp:tts',
'<(DEPTH)/tizen_src/build/system.gyp:capi-system-sensor',
],
'external_content_renderer_deps': [
- '<(DEPTH)/tizen_src/build/system.gyp:gstreamer',
'<(DEPTH)/tizen_src/build/system.gyp:tts',
'<(DEPTH)/tizen_src/chromium_impl/content/content_efl.gyp:android_content_detection',
],
'<(DEPTH)/tizen_src/build/system.gyp:ecore-wayland',
],
}],
- ],
- },
-
- 'conditions': [
- ['tizen_multimedia_use_capi_for_me==1', {
- 'variables': {
+ ['tizen_multimedia_use_capi_for_me==1', {
'external_content_browser_deps': [
'<(DEPTH)/tizen_src/build/system.gyp:capi-media-player',
'<(DEPTH)/tizen_src/build/system.gyp:capi-media-tool',
+ ],
+ }],
+ ['tizen_multimedia_support==1', {
+ 'external_content_common_deps': [
+ '<(DEPTH)/tizen_src/build/system.gyp:gstreamer',
+ ],
+ 'external_content_browser_deps': [
+ '<(DEPTH)/tizen_src/build/system.gyp:gstreamer',
'<(DEPTH)/ui/gl/gl.gyp:gl',
],
- },
- }],
- ],
+ 'external_content_renderer_deps': [
+ '<(DEPTH)/tizen_src/build/system.gyp:gstreamer',
+ '<(DEPTH)/ui/gl/gl.gyp:gl',
+ ],
+ }],
+ ],
+ },
'target_defaults': {
'target_conditions': [
base::TimeDelta timestamp) {
gfx::Size size(gst_width_, gst_height_);
scoped_refptr<VideoFrame> video_frame = VideoFrame::WrapNativePixmap(
- VideoFrame::NATIVE_PIXMAP, size, gfx::Rect(size), size,
- timestamp, pixmap_id);
+ size, gfx::Rect(size), size, timestamp, pixmap_id);
FrameReady(video_frame);
}
#endif
+++ /dev/null
-/*
- * Copyright (C) 2014 Samsung Electronics. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "media/audio/tizen/audio_session_manager.h"
-
-#include <cstdlib>
-#include <cstring>
-#include <memory>
-#include <unistd.h>
-
-#include "base/logging.h"
-#include "config.h"
-
-namespace media {
-
-AudioSessionManager::AudioSessionManager()
- : m_eventType_(ASM_EVENT_NONE)
- , m_handle_(-1)
- , m_notifyCallback_(0)
- , m_processIdentifier_(getpid())
- , m_sessionType_(MM_SESSION_TYPE_NUM)
- , m_stateType_(ASM_STATE_NONE)
- , m_allocated_(false)
- , m_resources_() {
-}
-
-AudioSessionManager::~AudioSessionManager() {
- if (m_allocated_)
- DeallocateResources();
-
- UnregisterAudioSessionManager();
-}
-
-bool AudioSessionManager::RegisterAudioSessionManager(
- MMSessionType sessiontype,
- ASM_sound_cb_t notifyCallback,
- void* callbackData) {
- int error = _mm_session_util_read_type
- (m_processIdentifier_, reinterpret_cast<int*>(&m_sessionType_));
- if (error) {
- m_sessionType_ = sessiontype;
- error = mm_session_init((int)m_sessionType_);
- if (error) {
- LOG(ERROR) << "mm_session_init() failed.";
- return false;
- }
- }
- m_eventType_ = InterpretSessionToEvent(m_sessionType_);
- m_notifyCallback_ = notifyCallback;
- if (!ASM_register_sound
- (m_processIdentifier_, &m_handle_, m_eventType_, m_stateType_,
- m_notifyCallback_, callbackData, ASM_RESOURCE_NONE, &error)) {
- LOG(ERROR) << "register is failed. errcode = " << error;
- return false;
- }
- return true;
-}
-
-bool AudioSessionManager::UnregisterAudioSessionManager() {
- int error = 0;
- if (!ASM_unregister_sound(m_handle_, m_eventType_, &error)) {
- LOG(ERROR) << "unregister is failed. errcode = " << error;
- return false;
- }
- return true;
-}
-
-int AudioSessionManager::GetSoundState(ASM_sound_states_t* state) {
- int error = 0;
- if (!ASM_get_sound_state( m_handle_, m_eventType_, state, &error))
- LOG(ERROR) << "getSoundState is failed. errcode = " << error;
- return error;
-}
-
-bool AudioSessionManager::SetSoundState(ASM_sound_states_t state) {
- int error = 0;
- if (!ASM_set_sound_state(
- m_handle_, m_eventType_, state, ASM_RESOURCE_NONE, &error)) {
- LOG(ERROR) << "setSoundState is failed. errcode = " << error;
- return false;
- }
- return true;
-}
-
-ASM_sound_events_t AudioSessionManager::InterpretSessionToEvent(
- MMSessionType sessionType) {
- switch (sessionType) {
- case MM_SESSION_TYPE_SHARE:
- return ASM_EVENT_SHARE_MMPLAYER;
- case MM_SESSION_TYPE_EXCLUSIVE:
- return ASM_EVENT_EXCLUSIVE_MMPLAYER;
- default:
- return ASM_EVENT_NONE;
- }
-}
-
-bool AudioSessionManager::AllocateResources(GstElement* element) {
- GList* list = NULL;
- gst_element_query_resource(element, &list);
-
- ASM_request_resources_t toAllocate;
- toAllocate.requested_resources_num = 0;
- int i = 0;
- for (GList* resource(list); resource; resource = resource->next) {
- toAllocate.device_category[toAllocate.requested_resources_num]
- = static_cast<ASM_resource_t>(GPOINTER_TO_INT(resource->data));
- toAllocate.access_right[toAllocate.requested_resources_num]
- = ASM_RESOURCE_ACCESS_RIGHT_EXCLUSIVE;
-
- ++toAllocate.requested_resources_num;
- }
- g_list_free(list);
-
- if (!toAllocate.requested_resources_num) {
- LOG(ERROR) << "No resources requested by : " << GST_ELEMENT_NAME(element);
- return true;
- }
-
- if (MAX_RESOURCE_NUM < toAllocate.requested_resources_num
- + m_resources_.requested_resources_num) {
- toAllocate.requested_resources_num = 0;
- return false;
- }
-
- int error(0);
- ASM_allocate_resources(m_handle_, &toAllocate, false, &error);
- if (error) {
- LOG(ERROR) << "Error allocating ASM resource. errcode : " << error;
- return false;
- }
-
- // Register this resources as allocated for future deallocation
- for (int i = 0; i < toAllocate.requested_resources_num; ++i) {
- m_resources_.device_id[m_resources_.requested_resources_num]
- = toAllocate.device_id[i];
- m_resources_.device_category[m_resources_.requested_resources_num]
- = toAllocate.device_category[i];
- m_resources_.access_right[m_resources_.requested_resources_num]
- = toAllocate.access_right[i];
- ++m_resources_.requested_resources_num;
- }
- m_allocated_ = true;
- return true;
-}
-
-bool AudioSessionManager::DeallocateResources() {
- // No good rollback from failure during resource deallocation.
- // The only smart move in this case would be to kill process,
- // but do we really want to do it?
- // Hence we ignore possible errors during resource deallocation.
- int error(0);
- m_allocated_ = !ASM_deallocate_resources(m_handle_, &m_resources_, &error);
- if (error)
- LOG(ERROR) << "Error deallocating ASM resources. errcode : " << error;
- m_resources_.requested_resources_num = 0;
- return !m_allocated_;
-}
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2014 Samsung Electronics. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef AUDIO_SESSION_MANAGER_H_
-#define AUDIO_SESSION_MANAGER_H_
-
-#include <audio-session-manager.h>
-#include <gst/gst.h>
-#include <mm_session.h>
-#include <mm_session_private.h>
-
-#include "base/memory/ref_counted.h"
-
-namespace media {
-
-class AudioSessionManager : public base::RefCounted<AudioSessionManager> {
-public:
- static scoped_refptr<AudioSessionManager> CreateAudioSessionManager() {
- return make_scoped_refptr(new AudioSessionManager());
- }
-
- static void SetVolumeSessionToMediaType();
- static void ClearVolumeSessionFromMediaType();
-
- virtual ~AudioSessionManager();
-
- bool RegisterAudioSessionManager(MMSessionType, ASM_sound_cb_t, void*);
- bool UnregisterAudioSessionManager();
-
- int GetSoundState(ASM_sound_states_t*);
- bool SetSoundState(ASM_sound_states_t);
- ASM_sound_events_t InterpretSessionToEvent(MMSessionType);
- bool AllocateResources(GstElement*);
- bool DeallocateResources();
-
- bool IsEmpty() const;
-
-private:
- AudioSessionManager();
-
- ASM_sound_cb_t m_notifyCallback_;
- ASM_sound_events_t m_eventType_;
- ASM_sound_states_t m_stateType_;
- ASM_request_resources_t m_resources_;
-
- MMSessionType m_sessionType_;
-
- bool m_allocated_;
- int m_handle_;
- int m_processIdentifier_;
-};
-}
-#endif
const char* aacelements[] = {
"aacparse",
#if defined(TIZEN_MULTIMEDIA_USE_HW_CODEC)
- "omx_aacdec", "alsasink",
+ "omx_aacdec", "autoaudiosink",
#else
- "avdec_aac", "alsasink"
+ "avdec_aac", "autoaudiosink"
#endif
};
return;
}
g_signal_connect(video_sink_pad, "notify::caps",
- static_cast<G_CALLBACK>(OnVideoSinkCapsChangedCB), this);
+ G_CALLBACK(OnVideoSinkCapsChangedCB), this);
gst_object_unref(video_sink_pad);
}
}
}
case GST_MESSAGE_ELEMENT:
#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
- if (!IsXWindowHadleSet() &&
+ if (!IsXWindowHandleSet() &&
gst_is_video_overlay_prepare_window_handle_message(message)) {
XWindowIdPrepared(message);
}
#include "media/base/decoder_buffer.h"
#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
+#include <map>
+
#include "ui/gl/efl_pixmap.h"
#endif
#include "ui/gfx/geometry/size.h"
#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-#if defined(TIZEN_V_2_4)
-#include <player_internal.h>
-#elif defined(TIZEN_LEGACY_V_2_2_1)
+#if defined(USE_LEGACY_PLAYER_CAPI)
#include <player_product.h>
+#else
+#include <player_internal.h>
#endif
#endif // TIZEN_MULTIMEDIA_PIXMAP_SUPPORT
player_set_error_cb(player_, ErrorCb, this);
#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-#if defined(TIZEN_LEGACY_V_2_2_1)
+#if defined(USE_LEGACY_PLAYER_CAPI)
player_set_x11_display_visible (player_, true);
#else
player_set_display_visible (player_, true);
}
void MediaPlayerBridgeCapi::Seek(const double time) {
-#if defined(TIZEN_LEGACY_V_2_2_1)
+#if defined(USE_LEGACY_PLAYER_CAPI)
int err = player_set_position(player_, ConvertSecondsToMilliSeconds(time),
SeekCompletedCb, this);
#else
}
int postion = 0;
-#if defined(TIZEN_LEGACY_V_2_2_1)
+#if defined(USE_LEGACY_PLAYER_CAPI)
player_get_position(player_, &postion);
#else
player_get_play_position(player_, &postion);
#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
void MediaPlayerBridgeCapi::PlatformSurfaceUpdated() {
int postion = 0;
-#if defined(TIZEN_LEGACY_V_2_2_1)
+#if defined(USE_LEGACY_PLAYER_CAPI)
player_get_position(player_, &postion);
#else
player_get_play_position(player_, &postion);
}
int position;
-#if defined(TIZEN_LEGACY_V_2_2_1)
+#if defined(USE_LEGACY_PLAYER_CAPI)
player_get_position(player_, &position);
#else
player_get_play_position(player_, &position);
#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
scoped_refptr<gfx::EflPixmap> efl_pixmap_;
Ecore_X_Damage damage_;
- Ecore_Event_Handler* damage_handler;
+ Ecore_Event_Handler* damage_handler_;
#else
media_packet_h previous_packet_;
#endif
player_h player_;
int media_type_;
- unsigned int player_width_;
- unsigned int player_height_;
+ int player_width_;
+ int player_height_;
unsigned int video_format_;
bool is_end_reached_;
# found in the LICENSE file.
{
+ 'variables': {
+ 'variables': {
+ 'tizen_multimedia_use_capi_for_me%' : 1,
+ 'conditions': [
+ ['building_for_tizen==0 or (building_for_tizen_tv==1 and chromium_efl_tizen_version!="3.0")', {
+ 'tizen_multimedia_use_capi_for_me%' : 0,
+ }],
+ ],
+ },
+ 'tizen_multimedia_use_capi_for_me%': '<(tizen_multimedia_use_capi_for_me)',
+ },
+
'conditions': [
['use_ozone==1', {
'<(DEPTH)/ui/gl/gl.gyp:gl',
],
}],
+ ['building_for_tizen_tv==1 and chromium_efl_tizen_version!="3.0"', {
+ 'defines': [
+ 'USE_LEGACY_PLAYER_CAPI=1',
+ ],
+ }],
],
},
],
}],
- ['building_for_tizen_tv==1 and chromium_efl_tizen_version!="3.0"', {
- 'sources': [
- 'audio/tizen/audio_session_manager.h',
- 'audio/tizen/audio_session_manager.cc', # ASM
- ],
- }],
['tizen_multimedia_eme_support==1', {
'defines': [
'TIZEN_MULTIMEDIA_EME_SUPPORT=1',
'xwalk_link_against_chromium_ewk%': 0,
'tizen_multimedia_support%': 1,
- 'tizen_multimedia_use_capi_for_me%': 1,
'tizen_multimedia_eme_support%': 1,
'tizen_disable_gpu_thread%': 1,
'TIZEN_LEGACY_V_2_2_1=1',
],
}],
- ['tizen_multimedia_use_capi_for_me==1', {
- 'defines': [
- 'TIZEN_CAPI_PLAYER_SUPPORT=1',
- ],
- }],
['use_wayland==1', {
'defines': [
'USE_WAYLAND=1',