#ifdef USE_MIXER
#include "mixer/mixerticket.h"
#include "mixer/mixerticket_eventlistener.h"
-#endif // USE_MIXER
+#endif // USE_MIXER
#include "esplayer/espacket_logger.h"
#include "esplayer/message.hpp"
#include "esplayer/state_manager.hpp"
bool SetDisplay(const DisplayType& type, void* obj) override;
#ifdef USE_MIXER
bool SetDisplay(const DisplayType& type, MixerTicket* handle) override;
-#endif // USE_MIXER
+#endif // USE_MIXER
bool SetDisplay(const DisplayType& type, void* ecore_wl2_window, const int x,
const int y, const int w, const int h) override;
bool SetDisplaySubsurface(const DisplayType& type, void* ecore_wl2_subsurface,
kpi::EsCodecLoggerKeys MakeKpiKeys_();
#ifdef USE_MIXER
bool PrepareVideoMixingMode_(std::vector<Track>* tracks);
-#endif // USE_MIXER
+#endif // USE_MIXER
void InitValuesFromIni_();
private: // private types
#ifdef USE_MIXER
void OnMediaPacketVideoRawDecoded(
const DecodedVideoRawModePacket& packet) override;
-#endif // USE_MIXER
+#endif // USE_MIXER
private:
void ReadyToPrepare_(const TrackType& type);
private:
EsPlayer* handler_{nullptr};
};
-#endif // USE_MIXER
+#endif // USE_MIXER
private:
std::vector<Track> track_;
new TrackRendererEventListener(this)};
#ifdef USE_MIXER
std::unique_ptr<MixerListener> mixer_event_listener_{new MixerListener(this)};
-#endif // USE_MIXER
+#endif // USE_MIXER
std::unique_ptr<TrackRendererAdapter> trackrenderer_;
std::future<void> preparetask_;
PlayerAppInfo app_info_;
std::mutex audio_focus_m_;
bool enable_audio_pipeline_handle_ = true;
bool enable_rsc_alloc_handle_ = true;
-#endif // USE_MIXER
+#endif // USE_MIXER
DecodedVideoFrameBufferType vidoe_frame_buffer_type_ =
DecodedVideoFrameBufferType::kNone;
// for debugging
this, "can't deactivate audio stream, mixer will control audio stream");
return false;
}
-#endif // USE_MIXER
+#endif // USE_MIXER
if (!trackrenderer_->Deactivate(static_cast<TrackType>(type))) {
return false;
}
"can't activate audio stream, mixer will control audio stream");
return false;
}
-#endif // USE_MIXER
+#endif // USE_MIXER
if (!track_.empty()) {
auto has_track = [type](const Track& item) -> bool {
return item.type == static_cast<TrackType>(type);
trackrenderer_->SetVideoFrameBufferType(
VideoFrameTypeStrategyPtr(new RawVideoFrameTypeStrategy()));
else
-#endif // USE_MIXER
+#endif // USE_MIXER
trackrenderer_->SetVideoFrameBufferType(VideoFrameTypeStrategyPtr(
new DefaultVideoFrameTypeStrategy(vidoe_frame_buffer_type_)));
}
this, "can't deactivate audio stream, mixer will control audio stream");
return false;
}
-#endif // USE_MIXER
+#endif // USE_MIXER
if (!trackrenderer_->DeactivateAudio()) {
return false;
}
"can't activate audio stream, mixer will control audio stream");
return false;
}
-#endif // USE_MIXER
+#endif // USE_MIXER
if (track_.empty()) {
return false;
}
ResetContextForStop_();
#ifdef USE_MIXER
if (mixer_ticket_) mixer_ticket_.reset();
-#endif // USE_MIXER
+#endif // USE_MIXER
performance_checker::End(start, "Stop");
return true;
};
}
return true;
}
-#endif // USE_MIXER
+#endif // USE_MIXER
// LCOV_EXCL_START
bool EsPlayer::Prepare_() {
}
}
}
-#endif // USE_MIXER
+#endif // USE_MIXER
for (const auto& track : active_track) {
switch (track.type) {
case kTrackTypeAudio: {
}
#ifdef USE_MIXER
if (mixer_ticket_) mixer_ticket_.reset();
-#endif // USE_MIXER
+#endif // USE_MIXER
return trackrenderer_->SetDisplay(type, obj);
}
}
return true;
}
-#endif // USE_MIXER
+#endif // USE_MIXER
bool EsPlayer::SetDisplay(const DisplayType& type, void* ecore_wl2_window,
const int x, const int y, const int w, const int h) {
}
#ifdef USE_MIXER
if (mixer_ticket_) mixer_ticket_.reset();
-#endif // USE_MIXER
+#endif // USE_MIXER
return trackrenderer_->SetDisplay(type, ecore_wl2_window, x, y, w, h);
}
}
#ifdef USE_MIXER
if (mixer_ticket_) mixer_ticket_.reset();
-#endif // USE_MIXER
+#endif // USE_MIXER
return trackrenderer_->SetDisplaySubsurface(type, ecore_wl2_subsurface, x, y,
w, h);
}
}
#ifdef USE_MIXER
if (mixer_ticket_) mixer_ticket_.reset();
-#endif // USE_MIXER
+#endif // USE_MIXER
return trackrenderer_->SetDisplay(type, surface_id, x, y, w, h);
}
// LCOV_EXCL_START
#ifdef USE_MIXER
mixerticket_roi_ = roi;
if (mixer_ticket_) return true;
-#endif // USE_MIXER
+#endif // USE_MIXER
return trackrenderer_->SetDisplayRoi(roi);
}
is_visible_ = is_visible;
return true;
}
-#endif // USE_MIXER
+#endif // USE_MIXER
return trackrenderer_->SetDisplayVisible(is_visible);
}
video_decoding_mode_ = internal::kNdecodingMode;
return true;
}
-#endif // USE_MIXER
+#endif // USE_MIXER
LOG_INFO_P(this, "PlayerVideoCodecType [%s]",
(type == kPlayerVideoCodecTypeHW) ? "hardware" : "software");
video_codec_type_ = type;
LOG_ERROR_P(this, "player can't control resource type, mixer will do it");
return false;
}
-#endif // USE_MIXER
+#endif // USE_MIXER
if (resource_alloc_policy_ > RscAllocPolicy::kRscAllocExclusive) {
LOG_ERROR_P(this,
"has set resource allocate policy, the alternative "
handler_->is_visible_ ? VisibleStatus::kVisible : VisibleStatus::kHide;
return true;
}
-#endif // USE_MIXER
+#endif // USE_MIXER
// LCOV_EXCL_STOP
void EsPlayer::TrackRendererEventListener::OnSeekData(const TrackType& type,
#include "esplusplayer_capi/esplusplayer_internal.h"
#if defined(USE_MIXER) && !defined(IS_TOMATO)
#include "mixer_capi/mixer_capi.h"
-#endif // defined(USE_MIXER) && !defined(IS_TOMATO)
+#endif // defined(USE_MIXER) && !defined(IS_TOMATO)
#include "esplusplayer/appinfo.h"
#include "esplusplayer/audioeasinginfo.h"
#include "esplusplayer/drm.h"
return convert_return_type_(
cast_(handle)->SetDisplay(static_cast<DisplayType>(type), ticket));
}
-#endif // defined(USE_MIXER) && !defined(IS_TOMATO)
+#endif // defined(USE_MIXER) && !defined(IS_TOMATO)
return convert_return_type_(
cast_(handle)->SetDisplay(static_cast<DisplayType>(type), window));
}
#include <Ecore_Evas.h>
-#include "gmock/gmock.h"
-
-#include "core/utils/plusplayer_log.h"
-#include "esplusplayer_capi/esplusplayer_capi.h"
-#include "mixer_capi/mixer_capi.h"
-#include "esplusplayer/types/display.h"
-#include "ut/include/appwindow.h"
-
#include <condition_variable>
#include <functional>
#include <future>
-
#include <memory>
#include <mutex>
#include <string>
#include <thread>
#include <vector>
+#include "core/utils/plusplayer_log.h"
+#include "esplusplayer/types/display.h"
+#include "esplusplayer_capi/esplusplayer_capi.h"
+#include "gmock/gmock.h"
+#include "mixer_capi/mixer_capi.h"
+#include "ut/include/appwindow.h"
+
#define DEFAULT_TIMEOUT_FOR_PREPARING (95 * 1000)
#define DEFAULT_TIMEOUT_FOR_SEEKING (25 * 1000)
#define EOS_WAIT_TIME 10000
class Utility;
using evas_h = Evas_Object*;
-enum EsType {
- kAudio = 0x01,
- kVideo = 0x02,
- kBoth = (kAudio | kVideo)
-};
+enum EsType { kAudio = 0x01, kVideo = 0x02, kBoth = (kAudio | kVideo) };
class Utility {
public:
static std::vector<std::string> Split(std::string in, char delimiter);
static bool IsChipset(const char* name);
static esplusplayer_video_mime_type ConvertToMimeType(
- const std::string &mimetype) {
+ const std::string& mimetype) {
static std::unordered_map<std::string, esplusplayer_video_mime_type>
kMimeTypeMap = {
{"video/x-h264", ESPLUSPLAYER_VIDEO_MIME_TYPE_H264},
}
static esplusplayer_audio_mime_type ConvertToMimeType(
- const std::string &mimetype, const std::string &format) {
+ const std::string& mimetype, const std::string& format) {
if (mimetype.compare("audio/x-raw") == 0) {
static std::unordered_map<std::string, esplusplayer_audio_mime_type>
kPcmFormatMap = {
esplusplayer_handle GetStartedMixESPP(std::string& uri, mixer_handle mixer,
esplusplayer::Geometry& roi);
-#endif // USE_MIXER
+#endif // USE_MIXER
esplusplayer_handle GetOpenedESPP(esplusplayer::Geometry& roi);
esplusplayer_handle GetPreparedESPP(std::string& uri,
esplusplayer::Geometry& roi);
- esplusplayer_handle GetStartedESPP(std::string& uri, esplusplayer::Geometry& roi);
+ esplusplayer_handle GetStartedESPP(std::string& uri,
+ esplusplayer::Geometry& roi);
bool PrepareESPP(esplusplayer_handle player, std::string& uri,
EsType type = EsType::kBoth);
int CaptureYUV(int capture_width, int capture_height, char* ybuff,
char* cbuff, int ysize, int csize,
std::string result_file_path);
-
+
int CaptureJPG(const int capture_width, const int capture_height, char* ybuff,
char* cbuff, const int ysize, const int csize,
std::string img_file_path);
-
+
int CheckYUV(int x, int y);
bool IsAudioDisconnected();
- bool IsAudioConnected() {return !IsAudioDisconnected();}
+ bool IsAudioConnected() { return !IsAudioDisconnected(); }
bool IsAudioMute();
- bool IsAudioUnmute() {return !IsAudioMute();}
+ bool IsAudioUnmute() { return !IsAudioMute(); }
int GetPlayingTimeForManualTestInMsec();
Utility(const Utility& rhs) = delete;
DiagnosisAudioControl* audioDiagnoser = nullptr;
};
-enum class WatcherStatus {
- kSuccess,
- kFail
-};
+enum class WatcherStatus { kSuccess, kFail };
-enum PrepareStatus {
- kReady,
- kSuccess,
- kFail
-};
+enum PrepareStatus { kReady, kSuccess, kFail };
static const int TIMEOUT_10_SEC = 10 * 1000;
+#include "ut/include/utils/utility.h"
+
#include <Ecore.h>
#include <Elementary.h>
+#include <capi-system-info/system_info.h>
+#include <capi-system-info/system_info_key.h>
#include <gtest/gtest.h>
+#include <jconfig.h>
+#include <jpeglib.h>
+#include <math.h>
+#include <poll.h>
+#include <system-type/system_type_enum.h>
+#include <unistd.h>
+
#include <algorithm>
#include <cassert>
#include <chrono>
+#include <fstream>
#include <memory>
-#include <unistd.h>
-#include <poll.h>
-
-#include "ut/include/utils/utility.h"
-#include "ut/include/esplusplayer/eseventlistener.hpp"
-#include "ut/include/esplusplayer/esreader.hpp"
-
-#include <math.h>
-#include <fstream>
-#include <jconfig.h>
-#include <jpeglib.h>
-#include <capi-system-info/system_info.h>
-#include <capi-system-info/system_info_key.h>
-#include <system-type/system_type_enum.h>
-#include "ivideocapture.hpp"
#include "capi-video-capture.h"
-#include "iaudio-control.hpp"
#include "diagnosis-audio-control.hpp"
+#include "iaudio-control.hpp"
+#include "ivideocapture.hpp"
+#include "ut/include/esplusplayer/eseventlistener.hpp"
+#include "ut/include/esplusplayer/esreader.hpp"
using namespace std;
using namespace esplusplayer;
-//using namespace tc;
+// using namespace tc;
using UserData = void*;
namespace utils {
printf("esplusplayer_start failed\n");
return nullptr;
}
-#endif // USE_MIXER
+#endif // USE_MIXER
esplusplayer_handle Utility::GetOpenedESPP(Geometry& roi) {
esplusplayer_handle player = esplusplayer_create();
memset(&pkt, 0, sizeof(esplusplayer_es_packet));
if (!reader->ReadNextPacket(pkt)) break;
esplusplayer_submit_packet(player, &pkt);
- delete []pkt.buffer;
+ delete[] pkt.buffer;
}
};
if (type == ESPLUSPLAYER_STREAM_TYPE_VIDEO) {
}
void ResizeCopy(unsigned int m_width, unsigned int m_height,
- unsigned int m_rwidth, unsigned int m_rheight,
- char* c_ptr, char* y_ptr, unsigned char* dest,
- unsigned int color_format) {
+ unsigned int m_rwidth, unsigned int m_rheight, char* c_ptr,
+ char* y_ptr, unsigned char* dest, unsigned int color_format) {
unsigned int omit = 1;
unsigned int x = 0;
unsigned int y = 0;
for (y = 0; y < m_height; y++) {
if ((y + 1) % omit || !resize) {
for (x = 0; x < m_width; x += sizeof(unsigned int)) {
-
unsigned int Yplain =
*((unsigned int*)((void*)(y_ptr + y * m_width + x)));
unsigned int Cplain =
break;
}
if ((x + 4) % omit || !resize) {
- dest[inc++] = (Yplain) & 0xFF;
+ dest[inc++] = (Yplain)&0xFF;
dest[inc++] = Cplain & 0xFF;
dest[inc++] = (Cplain >> 8) & 0xFF;
}
if ((x + 3) % omit || !resize) {
dest[inc++] = (Yplain >> 8) & 0xFF;
- dest[inc++] = (Cplain) & 0xFF;
+ dest[inc++] = (Cplain)&0xFF;
dest[inc++] = (Cplain >> 8) & 0xFF;
}
}
}
-int Utility::CaptureYUV(int capture_width, int capture_height,
- char* ybuff, char* cbuff, int ysize,
- int csize, std::string result_file_path) {
+int Utility::CaptureYUV(int capture_width, int capture_height, char* ybuff,
+ char* cbuff, int ysize, int csize,
+ std::string result_file_path) {
// screen capture
IVideoCapture* VCObjptr = IVideoCapture::getInstance();
IVideoCapture::InputParams input_params;
-
+
input_params.capture_w = capture_width;
input_params.capture_h = capture_height;
return 0;
}
-///TODO:: Modify the API to return the pointer instead of writing it as an image file.
+/// TODO:: Modify the API to return the pointer instead of writing it as an
+/// image file.
int Utility::CaptureJPG(const int capture_width, const int capture_height,
char* ybuff, char* cbuff, const int ysize,
const int csize, std::string img_file_path) {
}
int Utility::CheckYUV(int x, int y) {
-
/* screen capture */
IVideoCapture* VCObjptr = IVideoCapture::getInstance();
int CAPTURE_BUF_SIZE = CAPTURE_WIDTH * CAPTURE_HEIGHT;
char ybuff[CAPTURE_BUF_SIZE] = {0};
char cbuff[CAPTURE_BUF_SIZE] = {0};
-
+
IVideoCapture::InputParams input_params;
input_params.capture_w = 640;
input_params.capture_h = 360;
VCObjptr->getVideoPostYUV(input_params, output_params);
- /* check YUV value. As the capture size (640 x 360) is mapped with the full screen (1920 x 1080), the position should be resized. */
+ /* check YUV value. As the capture size (640 x 360) is mapped with the full
+ * screen (1920 x 1080), the position should be resized. */
int new_X = x / 3;
int new_Y = y / 3;
int position = CAPTURE_WIDTH * (new_Y - 1) + new_X;
-
+
LOGE("Y value : %d", (int)ybuff[position]);
return (int)ybuff[position];
}
bool Utility::IsAudioMute() {
long audioMute = 0;
- EXPECT_EQ(audioDiagnoser->Diagnosis_GetBoolean(0, "main out mute", &audioMute), 0);
+ EXPECT_EQ(
+ audioDiagnoser->Diagnosis_GetBoolean(0, "main out mute", &audioMute), 0);
return (audioMute != 0);
}
}
std::string Utility::getKeyboardInput(int timeoutMsec) {
- struct pollfd pfd = { STDIN_FILENO, POLLIN, 0 };
+ struct pollfd pfd = {STDIN_FILENO, POLLIN, 0};
std::string line = "";
int ret = poll(&pfd, 1, timeoutMsec);
- if(ret == 1) {// there is something to read
+ if (ret == 1) { // there is something to read
std::getline(std::cin, line);
}
return line;
while (getline(ss, line)) {
stringstream liness(line);
string token;
- while(getline(liness, token, delimiter)) {
+ while (getline(liness, token, delimiter)) {
if (!token.empty()) {
result.push_back(token);
}