Name: libtrackrenderer
Summary: new multimedia streaming player trackrenderer
-Version: 0.0.20
+Version: 0.0.21
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0
BuildRequires: pkgconfig(wayland-client)
BuildRequires: pkgconfig(tizen-extension-client)
BuildRequires: pkgconfig(jsoncpp)
-BuildRequires: pkgconfig(icu-i18n)
-BuildRequires: pkgconfig(vconf)
BuildRequires: pkgconfig(capi-system-info)
BuildRequires: pkgconfig(gio-2.0)
BuildRequires: pkgconfig(libtbm)
SET(dependents "gstreamer-1.0 gstreamer-plugins-base-1.0 gstreamer-video-1.0 gstreamer-allocators-1.0"
"boost"
- "vconf"
"elementary ecore ecore-wl2"
"libtbm"
"jsoncpp"
kLowLatencyModeNone = 0x0000,
kLowLatencyModeAudio = 0x0001,
kLowLatencyModeVideo = 0x0010,
+ kLowLatencyModeVideoDistortionConcealment =
+ kLowLatencyModeVideo | 0x0020,
kLowLatencyModeDisableAVSync = 0x0100,
- kLowLatencyModeDisableVideoQuality = 0x1000
+ kLowLatencyModeDisablePreroll = 0x0200,
+ kLowLatencyModeDisableVideoQuality = 0x1000,
+ kLowLatencyModeEnableGameMode =
+ kLowLatencyModeAudio | kLowLatencyModeVideo | 0x2000,
+ kLowLatencyModeEnableGameModeWithFixedResolution =
+ kLowLatencyModeEnableGameMode | 0x4000
};
enum class SubState {
kAudioMinByteThreshold, // std::uint32_t
kVideoQueueMaxBuffer, // std::uint64_t
kAudioQueueMaxBuffer, // std::uint64_t
+ kVideoRenderTimeOffset, // std::int64_t
+ kAudioRenderTimeOffset, // std::int64_t
kMax,
};
plusplayer::trackrenderer::Attribute::kVideoQueueMaxBuffer}},
{"audio-queue-max-buffer",
{ValueType::kUInt64,
- plusplayer::trackrenderer::Attribute::kAudioQueueMaxBuffer}}};
+ plusplayer::trackrenderer::Attribute::kAudioQueueMaxBuffer}},
+ {"video-render-time-offset",
+ {ValueType::kInt64,
+ plusplayer::trackrenderer::Attribute::kVideoRenderTimeOffset}},
+ {"audio-render-time-offset",
+ {ValueType::kInt64,
+ plusplayer::trackrenderer::Attribute::kAudioRenderTimeOffset}}};
static const std::map<std::string, ValueType> kConfigInfoTable = {
{ConfigNameAccurateSeekMode, ValueType::kUInt32},
GstCaps* a_decoder_caps,
const std::vector<Track>& tracks,
drm::Type drm_type) = 0;
- virtual void VconfSetMsgShow() = 0;
- virtual void VconfSetMsgUpdate() = 0;
- virtual void VconfSetMsgHide() = 0;
protected:
PlayinfoSetter() noexcept {}
TRACKRENDERER_INFO("Set pipeline state to GST_STATE_NULL.");
pipeline_->SetState(Elements::kPipeline, GST_STATE_NULL);
ReleaseResource_();
- playback_info_->VconfSetMsgHide();
TRACKRENDERER_LEAVE;
return true;
}
if (low_latency_mode_ == 0) return;
switch (type) {
case kTrackTypeAudio:
- if (low_latency_mode_ & kLowLatencyModeAudio) {
- pipeline_->SetProperty(Elements::kDecAudio, "decoding-type", 0x01);
- pipeline_->SetProperty(Elements::kSinkAudio, "device-latency", 0);
- }
- if (low_latency_mode_ & kLowLatencyModeDisableAVSync) {
- pipeline_->SetProperty(Elements::kSinkAudio, "sync", FALSE, "async",
- FALSE);
- pipeline_->SetProperty(Elements::kSinkAudio, "fast-rendering", 0);
- pipeline_->SetProperty(Elements::kSinkAudio, "game-mode", TRUE);
- pipeline_->SetProperty(Elements::kSinkAudio, "free-run", TRUE);
+ if (low_latency_mode_ & kLowLatencyModeDisablePreroll) {
+ pipeline_->SetProperty(Elements::kSinkAudio, "async", FALSE);
}
break;
case kTrackTypeVideo:
- if (low_latency_mode_ & kLowLatencyModeVideo) {
- pipeline_->SetProperty(Elements::kDecVideo, "decoding-type", 0x01);
- }
- if (low_latency_mode_ & kLowLatencyModeDisableAVSync) {
- pipeline_->SetProperty(Elements::kSinkVideo, "sync", FALSE, "async",
- FALSE);
+ if (low_latency_mode_ & kLowLatencyModeDisablePreroll) {
+ pipeline_->SetProperty(Elements::kSinkVideo, "async", FALSE);
}
break;
case kTrackTypeSubtitle:
break;
default:
TRACKRENDERER_ERROR("wrong track type");
+ break;
}
}
video_sink_caps.get(), video_decoder_caps.get(),
audio_decoder_caps.get(), trackinfo_, drm_property_.type))
return;
- if (is_updating)
- playback_info_->VconfSetMsgUpdate();
- else
- playback_info_->VconfSetMsgShow();
}
GstPadProbeReturn TrackRenderer::GstSrcPadProbeBlockCb_(GstPad* pad,
constexpr std::uint32_t kMinTimeThresholdOfAudio = 0; // 0%
constexpr std::uint64_t kMaxBufferOfVideoSrcQueue = 5; // cnt
constexpr std::uint64_t kMaxBufferOfAudioSrcQueue = 5; // cnt
+constexpr std::int64_t kDefaultRenderTimeOffset = 0;
template <typename ValueType>
bool IsSameValue(const boost::any& v1, const boost::any& v2) {
PROPERTY("max-buffers"), //
WITH_INIT, //
DEFAULT_VALUE(::kMaxBufferOfAudioSrcQueue)), //
+ MAKE_ATTRIBUTE(kVideoRenderTimeOffset, //
+ ELEMENT(kSinkVideo), //
+ VALUE_TYPE(std::int64_t), //
+ PROPERTY("ts-offset"), //
+ WITHOUT_INIT, //
+ DEFAULT_VALUE(::kDefaultRenderTimeOffset)), //
+ MAKE_ATTRIBUTE(kAudioRenderTimeOffset, //
+ ELEMENT(kSinkAudio), //
+ VALUE_TYPE(std::int64_t), //
+ PROPERTY("ts-offset"), //
+ WITHOUT_INIT, //
+ DEFAULT_VALUE(::kDefaultRenderTimeOffset)), //
};
const TrackRenderer::AttributesByElement TrackRenderer::kAttributesByElem_ =
#include "trackrenderer/trackrenderer_debug.h"
-#include <vconf.h>
#include <boost/filesystem/fstream.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/path.hpp>
bool SetStreamInfo(GstCaps* v_sink_caps, GstCaps* v_decoder_caps,
GstCaps* a_decoder_caps, const std::vector<Track>& tracks,
drm::Type drm_type) override;
- void VconfSetMsgShow() override;
- void VconfSetMsgUpdate() override;
- void VconfSetMsgHide() override;
private:
bool is_shown_ = false;
StreamInfo stream_info_;
};
-static const char* VCONF_KEY_FOR_PLAYBACK_INFO = "memory/mm/playinfo";
-
-static gboolean SendMessage(gpointer data) {
- std::stringstream* msg = (std::stringstream*)data;
- // TRACKRENDERER_INFO("%s", msg->str().c_str());
- vconf_set_str(VCONF_KEY_FOR_PLAYBACK_INFO, msg->str().c_str());
- return false;
-}
-
-static void MessageDestructor(gpointer data) {
- std::stringstream* msg = (std::stringstream*)data;
- // TRACKRENDERER_INFO("%s", msg->str().c_str());
- delete msg;
- return;
-}
-
std::string toString(drm::Type type) {
const char* drm_type = NULL;
switch (type) {
return true;
}
-void ConcretePlayinfoSetter::VconfSetMsgShow() {
- auto message = std::unique_ptr<std::stringstream>(new std::stringstream);
- *message.get() << "&display_mode=show";
- FillMsgWithStreamInfo(stream_info_, message.get());
-
- TRACKRENDERER_INFO("display : %s", message.get()->str().c_str());
- g_idle_add_full(G_PRIORITY_DEFAULT_IDLE, (GSourceFunc)SendMessage,
- (gpointer)message.release(), MessageDestructor);
- is_shown_ = true;
- return;
-}
-
-void ConcretePlayinfoSetter::VconfSetMsgUpdate() {
- if (!is_shown_) return;
-
- auto message = std::unique_ptr<std::stringstream>(new std::stringstream);
- *message.get() << "&display_mode=update";
- FillMsgWithStreamInfo(stream_info_, message.get());
-
- TRACKRENDERER_INFO("display : %s", message.get()->str().c_str());
- g_idle_add_full(G_PRIORITY_DEFAULT_IDLE, (GSourceFunc)SendMessage,
- (gpointer)message.release(), MessageDestructor);
- return;
-}
-
-void ConcretePlayinfoSetter::VconfSetMsgHide() {
- if (!is_shown_) return;
- auto message = std::unique_ptr<std::stringstream>(new std::stringstream);
- *message.get() << "&display_mode=hide";
-
- TRACKRENDERER_INFO("display : %s", message.get()->str().c_str());
- g_idle_add_full(G_PRIORITY_DEFAULT_IDLE, (GSourceFunc)SendMessage,
- (gpointer)message.release(), MessageDestructor);
- is_shown_ = false;
- return;
-}
-
} // namespace debug
} // namespace trackrenderer