const char kPadProbeCapsEvent[] = "CAPS_EVENT_DOWNSTREAM";
const char kPadProbeAppsrcEvent[] = "APPSRC_EVENT_DOWNSTREAM";
+const char kVideoSinkName[] = "tizenwlsink";
+const char kAudioSinkName[] = "pulsesink";
+
// Hw clock
#ifndef PR_TASK_PERF_USER_TRACE
#define PR_TASK_PERF_USER_TRACE 666
}
}
-bool IsSdkEnabledFeature() {
-#ifdef SDK_ENABLED_FEATURE
- return true;
-#endif
- return false;
-}
-
inline bool IsPcmMimeType(const std::string& mimetype) {
return (mimetype.find("audio/x-raw") != std::string::npos);
}
-const char* GetAudioSinkPluginName(bool swdecoder,
- const std::string& mimetype) {
- return "pulsesink";
-}
-
const char* GetIniElement(const std::map<std::string, std::string>& elements,
const std::string& key) {
auto look = elements.find(key);
return look->second.c_str();
}
-const char* GetVideoSinkPluginName(const std::map<std::string, std::string>& ini_elements,
- bool swdecoder) {
- const char* videosink = GetIniElement(ini_elements, "videosink_element_overlay");
- if (!videosink)
- return "tizenwlsink";
-
- return videosink;
-}
-
bool GetIniValue(const std::map<std::string, bool>& properties,
const std::string& key) {
auto look = properties.find(key);
TRACKRENDERER_ENTER;
std::lock_guard<std::mutex> lk(resource_m_);
if (state_ == State::kStopped) return false;
- if (!pipeline_) {
+ if (!pipeline_)
return false;
- }
- // mute off/on values are defined in mmaudiosink element
- static const int mute_off = 2;
- static const int mute_on = 3;
-
- int mute_flag = audio_mute ? mute_on : mute_off;
auto is_audio_track = [](const Track& item) noexcept -> bool {
return item.mimetype.find("audio") != std::string::npos;
};
auto target = find_if(trackinfo_.begin(), trackinfo_.end(), is_audio_track);
- if (target != trackinfo_.end()) {
- if (target->use_swdecoder || internal::IsSdkEnabledFeature()) {
- pipeline_->SetProperty(Elements::kSinkAudio, "mute", mute_flag % 2);
- } else {
- pipeline_->SetProperty(Elements::kSinkAudio, "mute-mask", mute_flag);
- }
- }
+ if (target != trackinfo_.end())
+ pipeline_->SetProperty(Elements::kSinkAudio, "mute", audio_mute);
int flags = GST_SEEK_FLAG_FLUSH;
if (is_accurate_seek_)
TRACKRENDERER_ENTER;
std::lock_guard<std::mutex> lk(resource_m_);
if (state_ == State::kStopped) return false;
- if (!pipeline_) {
- return false;
- }
- // mute off/on values are defined in mmaudiosink element
- static const int mute_off = 2;
- static const int mute_on = 3;
+ if (!pipeline_) return false;
+
uint64_t last_video_pts = 0, curtime_in_msec = 0;
- int mute_flag = audio_mute ? mute_on : mute_off;
+
GetPlayingTime_(&curtime_in_msec);
- TRACKRENDERER_INFO("Set mute-mask property as [%d] ,rate [%lf]", mute_flag,
+ TRACKRENDERER_INFO("Set audio mute property as [%d], rate [%lf]", audio_mute,
playback_rate);
auto is_audio_track = [](const Track& item) noexcept -> bool {
return item.mimetype.find("audio") != std::string::npos;
};
auto target = find_if(trackinfo_.begin(), trackinfo_.end(), is_audio_track);
- if (target != trackinfo_.end()) {
- if (target->use_swdecoder || internal::IsSdkEnabledFeature()) {
- pipeline_->SetProperty(Elements::kSinkAudio, "mute", mute_flag % 2);
- } else {
- pipeline_->SetProperty(Elements::kSinkAudio, "mute-mask", mute_flag);
- pipeline_->SetProperty(Elements::kDecAudio, "audio-playback-rate",
- gint(playback_rate * 100));
- pipeline_->SetProperty(Elements::kSinkAudio, "playback-rate",
- gint(playback_rate * 100));
- }
- }
+ if (target != trackinfo_.end())
+ pipeline_->SetProperty(Elements::kSinkAudio, "mute", audio_mute);
Elements audio_probe_element = Elements::kDecAudio;
Elements video_probe_element = Elements::kDecVideo;
display_->GetDisplay(&display_type);
const char* videosink_name = "fakesink";
if (internal::IsDisplayNeeded(display_type))
- videosink_name = internal::GetVideoSinkPluginName(ini_elements_, track->use_swdecoder);
+ videosink_name = kVideoSinkName;
if (!pipeline_->FactoryMake(Elements::kSinkVideo, videosink_name, NULL)) {
TRACKRENDERER_ERROR("fail to make video sink(%s)", videosink_name);
}
if (videosink_name &&
- (strstr(videosink_name, "fakesink") || strstr(videosink_name, "tizenwlsink"))) {
+ (strstr(videosink_name, "fakesink") || strstr(videosink_name, kVideoSinkName))) {
pipeline_->SignalConnect(Elements::kSinkVideo, "preroll-handoff",
G_CALLBACK(GstPrerollDecodedVideoBufferCb_), this);
pipeline_->SignalConnect(Elements::kSinkVideo, "handoff",
bool sw_codec = internal::GetIniValue(properties_, "use_default_video_codec_sw");
if (!sw_codec && pipeline_->IsFactoryListType(Elements::kDecVideo, GST_ELEMENT_FACTORY_TYPE_HARDWARE)) {
TRACKRENDERER_INFO("HW codec");
- if (videosink_name && strstr(videosink_name, "tizenwlsink"))
+ if (videosink_name && strstr(videosink_name, kVideoSinkName))
pipeline_->SetProperty(Elements::kSinkVideo, "use-tbm", true);
} else { /* sw */
TRACKRENDERER_INFO("SW codec");
pipeline_->FactoryMake(Elements::kVideoConvert, "videoconvert", NULL);
pipeline_->SetProperty(Elements::kVideoConvert, "n-threads", 2);
- if (videosink_name && strstr(videosink_name, "tizenwlsink"))
+ if (videosink_name && strstr(videosink_name, kVideoSinkName))
pipeline_->SetProperty(Elements::kSinkVideo, "use-tbm", false);
}
return false;
}
- pipeline_->FactoryMake(
- Elements::kSinkAudio,
- internal::GetAudioSinkPluginName(track->use_swdecoder, track->mimetype),
- NULL);
-
+ pipeline_->FactoryMake(Elements::kSinkAudio, kAudioSinkName, NULL);
pipeline_->SetProperty(Elements::kSinkAudio, "provide-clock", FALSE);
pipeline_->CreateBin(Elements::kBinAudio, "audiobin");
TRACKRENDERER_ENTER;
CreateAppSrc_(kTrackTypeAudio, track->mimetype);
- pipeline_->FactoryMake(
- Elements::kSinkAudio,
- internal::GetAudioSinkPluginName(track->use_swdecoder, track->mimetype),
- NULL);
+ pipeline_->FactoryMake(Elements::kSinkAudio, kAudioSinkName, NULL);
pipeline_->SetProperty(Elements::kSinkAudio, "drift-tolerance",
((200 * GST_MSECOND) / GST_USECOND));
pipeline_->SetProperty(Elements::kSinkAudio, "provide-clock", FALSE);
for (const Track& track : trackinfo_) {
if (track.active == false) continue;
if (track.type != kTrackTypeVideo) continue;
- if (internal::IsSdkEnabledFeature() || track.use_swdecoder) continue;
+ if (track.use_swdecoder) continue; // FIXME: need to acquire the renderer res
ResourceProperty videodecproperty;
videodecproperty.category = ResourceCategory::kVideoDecoder;
}
pipeline_->FactoryMake(Elements::kAudioConvert, "audioconvert", nullptr);
pipeline_->FactoryMake(Elements::kAudioResample, "audioresample", nullptr);
- pipeline_->FactoryMake(
- Elements::kSinkAudio,
- "pulsesink",
- nullptr);
+ pipeline_->FactoryMake(Elements::kSinkAudio, kAudioSinkName, nullptr);
pipeline_->SetProperty(Elements::kSinkAudio, "sync", TRUE, "async", TRUE, "provide-clock", FALSE);
pipeline_->SetProperty(Elements::kAppSrcAudio, "stream-type",
trackinfo_.push_back(track);
if (type == kTrackTypeVideo) {
- if (!internal::IsSdkEnabledFeature() && !track.use_swdecoder) { /* except sw */
+ if (!track.use_swdecoder) {
std::list<ResourceProperty> propertylist;
ResourceProperty videodecproperty;
videodecproperty.category = ResourceCategory::kVideoDecoder;
TRACKRENDERER_ERROR("Video resource acquire fail! ChangeTrack fail.");
return false;
}
- }
+ } // FIXME: need to acquire the renderer res
auto caps = caps_builder_.Build(track, internal::IsDrmEmeElementNecessary(
drm_property_, track.mimetype));
return false;
}
- pipeline_->FactoryMake(Elements::kSinkVideo,
- internal::GetVideoSinkPluginName(ini_elements_,
- track.use_swdecoder), NULL);
+ // FIXME: need to check display type
+ pipeline_->FactoryMake(Elements::kSinkVideo, kVideoSinkName, NULL);
pipeline_->SetProperty(Elements::kSinkVideo, "async", FALSE);
if (internal::IsDecryptorElementNecessary(drm_property_)) {
pipeline_->FactoryMake(Elements::kDrmVideo, "cencdecrypt", NULL);
TRACKRENDERER_WARN("no audio sink");
return;
}
- if (strstr(sink_name, "pulsesink")) {
+ if (strstr(sink_name, kAudioSinkName)) {
pipeline_->SetProperty(Elements::kSinkAudio, "volume", (volume_/100.0));
} else {
TRACKRENDERER_WARN("unknown audio sink name: %s", sink_name);
drm_property_, track.mimetype));
pipeline_->FactoryMake(Elements::kDecAudio, (GstCaps*)caps.GetCaps_(),
GST_ELEMENT_FACTORY_TYPE_DECODER, NULL);
- pipeline_->FactoryMake(
- Elements::kSinkAudio,
- internal::GetAudioSinkPluginName(track.use_swdecoder, track.mimetype),
- nullptr);
+ pipeline_->FactoryMake(Elements::kSinkAudio, kAudioSinkName, NULL);
if (volume_ != kVolumeNone) {
SetVolume_();
}
TRACKRENDERER_WARN("no video sink");
return;
}
- if (strstr(sink_name, "fakesink") || strstr(sink_name, "tizenwlsink")) {
+ if (strstr(sink_name, "fakesink") || strstr(sink_name, kVideoSinkName)) {
pipeline_->SetProperty(Elements::kSinkVideo, "signal-handoffs", is_video_hole_enabled_ ? false : true);
TRACKRENDERER_DEBUG("value: %d", is_video_hole_enabled_);
} else {