LOG_LEAVE
}
-
-
virtual void OnError(const ErrorType& error_code, UserData userdata) {
LOG_ENTER
LOG_INFO("error code : %x", static_cast<int>(error_code));
virtual void OnReadyToSeek(const StreamType& type, const uint64_t offset,
UserData userdata) {
LOG_ENTER
- LOG_INFO("offset : %" PRId64"", offset);
+ LOG_INFO("offset : %" PRId64 "", offset);
std::unique_lock<std::mutex> lock(this->multi_seek_control.lock);
if (this->multi_seek_control.is_offset_valid == false ||
this->multi_seek_control.offset != offset) {
- LOG_ERROR("Invalid offset:%" PRId64"", this->multi_seek_control.offset);
+ LOG_ERROR("Invalid offset:%" PRId64 "", this->multi_seek_control.offset);
return;
}
if (this->ready_to_seek_cb_)
}
virtual void OnVideoFrameDropped(const uint64_t& count, UserData userdata) {
- LOG_ERROR("count: %" PRId64"", count);
+ LOG_ERROR("count: %" PRId64 "", count);
if (this->video_frame_dropped_cb_)
this->video_frame_dropped_cb_(count, video_frame_dropped_cb_userdata_);
}
- virtual void OnDecoderInputBufferTime(const StreamType& type, const DecoderBufferTime& time) {
+ virtual void OnDecoderInputBufferTime(const StreamType& type,
+ const DecoderBufferTime& time) {
if (this->decoder_input_buffer_time_cb_) {
esplusplayer_decoder_buffer_time decoder_buffer_time;
decoder_buffer_time.pts = time.pts;
decoder_buffer_time.system_time = time.system_time;
this->decoder_input_buffer_time_cb_(
- static_cast<esplusplayer_stream_type>(type), decoder_buffer_time, decoder_input_buffer_time_cb_userdata_);
+ static_cast<esplusplayer_stream_type>(type), decoder_buffer_time,
+ decoder_input_buffer_time_cb_userdata_);
}
}
- virtual void OnDecoderOutputBufferTime(const StreamType& type, const DecoderBufferTime& time) {
+ virtual void OnDecoderOutputBufferTime(const StreamType& type,
+ const DecoderBufferTime& time) {
if (this->decoder_output_buffer_time_cb_) {
esplusplayer_decoder_buffer_time decoder_buffer_time;
decoder_buffer_time.pts = time.pts;
decoder_buffer_time.system_time = time.system_time;
this->decoder_output_buffer_time_cb_(
- static_cast<esplusplayer_stream_type>(type), decoder_buffer_time, decoder_output_buffer_time_cb_userdata_);
+ static_cast<esplusplayer_stream_type>(type), decoder_buffer_time,
+ decoder_output_buffer_time_cb_userdata_);
}
- }
+ }
private:
static void DecodedPacketDeleter(esplusplayer_decoded_video_packet* packet) {
void* audio_high_latency_cb_userdata_ = nullptr;
esplusplayer_video_frame_dropped_cb video_frame_dropped_cb_ = nullptr;
void* video_frame_dropped_cb_userdata_ = nullptr;
- esplusplayer_decoder_buffer_time_cb decoder_input_buffer_time_cb_ =
- nullptr;
- esplusplayer_decoder_buffer_time_cb decoder_output_buffer_time_cb_ =
- nullptr;
+ esplusplayer_decoder_buffer_time_cb decoder_input_buffer_time_cb_ = nullptr;
+ esplusplayer_decoder_buffer_time_cb decoder_output_buffer_time_cb_ = nullptr;
void* decoder_input_buffer_time_cb_userdata_ = nullptr;
void* decoder_output_buffer_time_cb_userdata_ = nullptr;
esplusplayer_video_frame_dropped_cb video_frame_dropped_cb,
void* userdata);
friend int esplusplayer_set_decoder_input_buffer_time_cb(
- esplusplayer_handle handle,
- esplusplayer_decoder_buffer_time_cb decoder_buffer_time_cb,
- void* userdata);
+ esplusplayer_handle handle,
+ esplusplayer_decoder_buffer_time_cb decoder_buffer_time_cb,
+ void* userdata);
friend int esplusplayer_set_decoder_output_buffer_time_cb(
- esplusplayer_handle handle,
- esplusplayer_decoder_buffer_time_cb decoder_buffer_time_cb,
- void* userdata);
+ esplusplayer_handle handle,
+ esplusplayer_decoder_buffer_time_cb decoder_buffer_time_cb,
+ void* userdata);
};
#define ES_DUMP 0
case esplusplayer::GetDecodedVideoFrameStatus::kUnknown: {
return ESPLUSPLAYER_GET_DECVIDEOFRAME_STATUS_UNKNOWN;
}
- default: { return ESPLUSPLAYER_GET_DECVIDEOFRAME_STATUS_UNKNOWN; }
+ default: {
+ return ESPLUSPLAYER_GET_DECVIDEOFRAME_STATUS_UNKNOWN;
+ }
}
return ESPLUSPLAYER_GET_DECVIDEOFRAME_STATUS_UNKNOWN;
}
}
int esplusplayer_set_app_info_ex(esplusplayer_handle handle,
- const esplusplayer_app_info_ex* app_info) {
+ const esplusplayer_app_info_ex* app_info) {
LOG_ENTER_P(cast_(handle))
if (is_null_(handle)) return ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER;
if (app_info == nullptr) return ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER;
return convert_return_type_(cast_(handle)->SetDisplayRoi(roi));
}
-int esplusplayer_set_stretch_mode(esplusplayer_handle handle,
- int mode) {
+int esplusplayer_set_stretch_mode(esplusplayer_handle handle, int mode) {
LOG_ENTER_P(cast_(handle))
if (is_null_(handle)) return ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER;
LOG_INFO_P(cast_(handle), "stretch mode : %d", static_cast<int>(mode));
- return convert_return_type_(
- cast_(handle)->SetStretchMode(mode));
+ return convert_return_type_(cast_(handle)->SetStretchMode(mode));
}
int esplusplayer_set_video_roi(esplusplayer_handle handle, double scale_x,
return convert_return_type_(ret);
}
-int esplusplayer_set_video_stream_rotation_info(esplusplayer_handle handle,
- const esplusplayer_video_stream_rotation_type rotation) {
+int esplusplayer_set_video_stream_rotation_info(
+ esplusplayer_handle handle,
+ const esplusplayer_video_stream_rotation_type rotation) {
LOG_ENTER_P(cast_(handle))
if (is_null_(handle)) return ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER;
LOG_INFO_P(cast_(handle), "video stream rotation type : %d",
static_cast<int>(rotation));
- return convert_return_type_(
- cast_(handle)->SetVideoStreamRotationInfo(static_cast<VideoRotation>(rotation)));
+ return convert_return_type_(cast_(handle)->SetVideoStreamRotationInfo(
+ static_cast<VideoRotation>(rotation)));
}
-int esplusplayer_get_video_stream_rotation_info(esplusplayer_handle handle,
- esplusplayer_video_stream_rotation_type* rotation) {
+int esplusplayer_get_video_stream_rotation_info(
+ esplusplayer_handle handle,
+ esplusplayer_video_stream_rotation_type* rotation) {
LOG_ENTER_P(cast_(handle))
if (is_null_(handle) || is_null_(rotation))
return ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER;
ESPLUSPLAYER_ERROR_TYPE_NONE);
ASSERT_TRUE(video_reader_->SetStreamInfo(esplayer_));
esplusplayer_audio_stream_info audio_stream1;
- audio_stream1.codec_data = nullptr;
- audio_stream1.codec_data_length = 0;
- audio_stream1.mime_type = ESPLUSPLAYER_AUDIO_MIME_TYPE_PCM_S16LE;
- audio_stream1.bitrate = 0;
- audio_stream1.sample_rate = 48000;
- audio_stream1.channels = 2;
-
- esplusplayer_set_audio_stream_info(esplayer_, &audio_stream1);
-
-
- esplusplayer_set_low_latency_mode(esplayer_, ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_PREROLL);
+ audio_stream1.codec_data = nullptr;
+ audio_stream1.codec_data_length = 0;
+ audio_stream1.mime_type = ESPLUSPLAYER_AUDIO_MIME_TYPE_PCM_S16LE;
+ audio_stream1.bitrate = 0;
+ audio_stream1.sample_rate = 48000;
+ audio_stream1.channels = 2;
+
+ esplusplayer_set_audio_stream_info(esplayer_, &audio_stream1);
+
+ esplusplayer_set_low_latency_mode(
+ esplayer_, ESPLUSPLAYER_LOW_LATENCY_MODE_DISABLE_PREROLL);
ASSERT_EQ(esplusplayer_prepare_async(esplayer_),
ESPLUSPLAYER_ERROR_TYPE_NONE);
callback_->WaitForPrepareDone();
audio_stream.bitrate = 448;
audio_stream.sample_rate = 48000;
audio_stream.channels = 6;
-
- esplusplayer_set_audio_stream_info(esplayer_, &audio_stream);
+ esplusplayer_set_audio_stream_info(esplayer_, &audio_stream);
- //audio_reader_->ResetReader();
+ // audio_reader_->ResetReader();
ASSERT_EQ(esplusplayer_activate(esplayer_, ESPLUSPLAYER_STREAM_TYPE_AUDIO),
ESPLUSPLAYER_ERROR_TYPE_NONE);
esplusplayer_set_display(esplayer_, ESPLUSPLAYER_DISPLAY_TYPE_OVERLAY,
window_->Window()),
ESPLUSPLAYER_ERROR_TYPE_NONE);
-
- ASSERT_EQ(esplusplayer_set_buffer_size(esplayer_,
- ESPLUSPLAYER_BUFFER_AUDIO_MAX_BYTE_SIZE, 1024*15),
- ESPLUSPLAYER_ERROR_TYPE_NONE);
- ASSERT_EQ(esplusplayer_set_buffer_size(esplayer_,
- ESPLUSPLAYER_BUFFER_VIDEO_MAX_BYTE_SIZE, 1024*15),
- ESPLUSPLAYER_ERROR_TYPE_NONE);
- ASSERT_EQ(esplusplayer_set_buffer_size(esplayer_,
- ESPLUSPLAYER_BUFFER_AUDIO_MAX_TIME_SIZE, 3000),
- ESPLUSPLAYER_ERROR_TYPE_NONE);
- ASSERT_EQ(esplusplayer_set_buffer_size(esplayer_,
- ESPLUSPLAYER_BUFFER_VIDEO_MAX_TIME_SIZE, 3000),
- ESPLUSPLAYER_ERROR_TYPE_NONE);
- ASSERT_EQ(esplusplayer_set_buffer_size(esplayer_,
- ESPLUSPLAYER_BUFFER_AUDIO_MIN_BYTE_THRESHOLD, 1024),
- ESPLUSPLAYER_ERROR_TYPE_NONE);
- ASSERT_EQ(esplusplayer_set_buffer_size(esplayer_,
- ESPLUSPLAYER_BUFFER_VIDEO_MIN_BYTE_THRESHOLD, 1024),
- ESPLUSPLAYER_ERROR_TYPE_NONE);
- ASSERT_EQ(esplusplayer_set_buffer_size(esplayer_,
- ESPLUSPLAYER_BUFFER_AUDIO_MIN_TIME_THRESHOLD, 1000),
- ESPLUSPLAYER_ERROR_TYPE_NONE);
- ASSERT_EQ(esplusplayer_set_buffer_size(esplayer_,
- ESPLUSPLAYER_BUFFER_VIDEO_MIN_TIME_THRESHOLD, 1000),
- ESPLUSPLAYER_ERROR_TYPE_NONE);
-
+
+ ASSERT_EQ(esplusplayer_set_buffer_size(
+ esplayer_, ESPLUSPLAYER_BUFFER_AUDIO_MAX_BYTE_SIZE, 1024 * 15),
+ ESPLUSPLAYER_ERROR_TYPE_NONE);
+ ASSERT_EQ(esplusplayer_set_buffer_size(
+ esplayer_, ESPLUSPLAYER_BUFFER_VIDEO_MAX_BYTE_SIZE, 1024 * 15),
+ ESPLUSPLAYER_ERROR_TYPE_NONE);
+ ASSERT_EQ(esplusplayer_set_buffer_size(
+ esplayer_, ESPLUSPLAYER_BUFFER_AUDIO_MAX_TIME_SIZE, 3000),
+ ESPLUSPLAYER_ERROR_TYPE_NONE);
+ ASSERT_EQ(esplusplayer_set_buffer_size(
+ esplayer_, ESPLUSPLAYER_BUFFER_VIDEO_MAX_TIME_SIZE, 3000),
+ ESPLUSPLAYER_ERROR_TYPE_NONE);
+ ASSERT_EQ(esplusplayer_set_buffer_size(
+ esplayer_, ESPLUSPLAYER_BUFFER_AUDIO_MIN_BYTE_THRESHOLD, 1024),
+ ESPLUSPLAYER_ERROR_TYPE_NONE);
+ ASSERT_EQ(esplusplayer_set_buffer_size(
+ esplayer_, ESPLUSPLAYER_BUFFER_VIDEO_MIN_BYTE_THRESHOLD, 1024),
+ ESPLUSPLAYER_ERROR_TYPE_NONE);
+ ASSERT_EQ(esplusplayer_set_buffer_size(
+ esplayer_, ESPLUSPLAYER_BUFFER_AUDIO_MIN_TIME_THRESHOLD, 1000),
+ ESPLUSPLAYER_ERROR_TYPE_NONE);
+ ASSERT_EQ(esplusplayer_set_buffer_size(
+ esplayer_, ESPLUSPLAYER_BUFFER_VIDEO_MIN_TIME_THRESHOLD, 1000),
+ ESPLUSPLAYER_ERROR_TYPE_NONE);
+
ASSERT_TRUE(video_reader_->SetStreamInfo(esplayer_));
ASSERT_TRUE(audio_reader_->SetStreamInfo(esplayer_));
ASSERT_EQ(esplusplayer_prepare_async(esplayer_),
ESPLUSPLAYER_ERROR_TYPE_NONE);
callback_->WaitForPrepareDone();
- ASSERT_EQ(esplusplayer_set_buffer_size(esplayer_,
- ESPLUSPLAYER_BUFFER_AUDIO_MAX_BYTE_SIZE, 1024*15),
- ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION);
- ASSERT_EQ(esplusplayer_set_buffer_size(esplayer_,
- ESPLUSPLAYER_BUFFER_VIDEO_MAX_BYTE_SIZE, 1024*15),
- ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION);
- ASSERT_EQ(esplusplayer_set_buffer_size(esplayer_,
- ESPLUSPLAYER_BUFFER_AUDIO_MAX_TIME_SIZE, 3000),
- ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION);
- ASSERT_EQ(esplusplayer_set_buffer_size(esplayer_,
- ESPLUSPLAYER_BUFFER_VIDEO_MAX_TIME_SIZE, 3000),
- ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION);
- ASSERT_EQ(esplusplayer_set_buffer_size(esplayer_,
- ESPLUSPLAYER_BUFFER_AUDIO_MIN_BYTE_THRESHOLD, 1024),
- ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION);
- ASSERT_EQ(esplusplayer_set_buffer_size(esplayer_,
- ESPLUSPLAYER_BUFFER_VIDEO_MIN_BYTE_THRESHOLD, 1024),
- ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION);
- ASSERT_EQ(esplusplayer_set_buffer_size(esplayer_,
- ESPLUSPLAYER_BUFFER_AUDIO_MIN_TIME_THRESHOLD, 1000),
- ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION);
- ASSERT_EQ(esplusplayer_set_buffer_size(esplayer_,
- ESPLUSPLAYER_BUFFER_VIDEO_MIN_TIME_THRESHOLD, 1000),
- ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION);
+ ASSERT_EQ(esplusplayer_set_buffer_size(
+ esplayer_, ESPLUSPLAYER_BUFFER_AUDIO_MAX_BYTE_SIZE, 1024 * 15),
+ ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION);
+ ASSERT_EQ(esplusplayer_set_buffer_size(
+ esplayer_, ESPLUSPLAYER_BUFFER_VIDEO_MAX_BYTE_SIZE, 1024 * 15),
+ ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION);
+ ASSERT_EQ(esplusplayer_set_buffer_size(
+ esplayer_, ESPLUSPLAYER_BUFFER_AUDIO_MAX_TIME_SIZE, 3000),
+ ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION);
+ ASSERT_EQ(esplusplayer_set_buffer_size(
+ esplayer_, ESPLUSPLAYER_BUFFER_VIDEO_MAX_TIME_SIZE, 3000),
+ ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION);
+ ASSERT_EQ(esplusplayer_set_buffer_size(
+ esplayer_, ESPLUSPLAYER_BUFFER_AUDIO_MIN_BYTE_THRESHOLD, 1024),
+ ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION);
+ ASSERT_EQ(esplusplayer_set_buffer_size(
+ esplayer_, ESPLUSPLAYER_BUFFER_VIDEO_MIN_BYTE_THRESHOLD, 1024),
+ ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION);
+ ASSERT_EQ(esplusplayer_set_buffer_size(
+ esplayer_, ESPLUSPLAYER_BUFFER_AUDIO_MIN_TIME_THRESHOLD, 1000),
+ ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION);
+ ASSERT_EQ(esplusplayer_set_buffer_size(
+ esplayer_, ESPLUSPLAYER_BUFFER_VIDEO_MIN_TIME_THRESHOLD, 1000),
+ ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION);
ASSERT_EQ(esplusplayer_start(esplayer_), ESPLUSPLAYER_ERROR_TYPE_NONE);
std::this_thread::sleep_for(std::chrono::seconds(3));
-
+
ASSERT_EQ(esplusplayer_deactivate(esplayer_, ESPLUSPLAYER_STREAM_TYPE_AUDIO),
ESPLUSPLAYER_ERROR_TYPE_NONE);
-
- ASSERT_EQ(esplusplayer_set_buffer_size(esplayer_,
- ESPLUSPLAYER_BUFFER_AUDIO_MAX_BYTE_SIZE, 1024*15),
- ESPLUSPLAYER_ERROR_TYPE_NONE);
- ASSERT_EQ(esplusplayer_set_buffer_size(esplayer_,
- ESPLUSPLAYER_BUFFER_AUDIO_MAX_TIME_SIZE, 3000),
- ESPLUSPLAYER_ERROR_TYPE_NONE);
- ASSERT_EQ(esplusplayer_set_buffer_size(esplayer_,
- ESPLUSPLAYER_BUFFER_AUDIO_MIN_BYTE_THRESHOLD, 1024),
- ESPLUSPLAYER_ERROR_TYPE_NONE);
- ASSERT_EQ(esplusplayer_set_buffer_size(esplayer_,
- ESPLUSPLAYER_BUFFER_AUDIO_MIN_TIME_THRESHOLD, 1000),
- ESPLUSPLAYER_ERROR_TYPE_NONE);
-
+
+ ASSERT_EQ(esplusplayer_set_buffer_size(
+ esplayer_, ESPLUSPLAYER_BUFFER_AUDIO_MAX_BYTE_SIZE, 1024 * 15),
+ ESPLUSPLAYER_ERROR_TYPE_NONE);
+ ASSERT_EQ(esplusplayer_set_buffer_size(
+ esplayer_, ESPLUSPLAYER_BUFFER_AUDIO_MAX_TIME_SIZE, 3000),
+ ESPLUSPLAYER_ERROR_TYPE_NONE);
+ ASSERT_EQ(esplusplayer_set_buffer_size(
+ esplayer_, ESPLUSPLAYER_BUFFER_AUDIO_MIN_BYTE_THRESHOLD, 1024),
+ ESPLUSPLAYER_ERROR_TYPE_NONE);
+ ASSERT_EQ(esplusplayer_set_buffer_size(
+ esplayer_, ESPLUSPLAYER_BUFFER_AUDIO_MIN_TIME_THRESHOLD, 1000),
+ ESPLUSPLAYER_ERROR_TYPE_NONE);
+
ASSERT_TRUE(audio_reader_->SetStreamInfo(esplayer_));
audio_reader_->ResetReader();
ASSERT_EQ(esplusplayer_activate(esplayer_, ESPLUSPLAYER_STREAM_TYPE_AUDIO),
ESPLUSPLAYER_ERROR_TYPE_NONE);
-
- ASSERT_EQ(esplusplayer_set_buffer_size(esplayer_,
- ESPLUSPLAYER_BUFFER_AUDIO_MAX_BYTE_SIZE, 1024*15),
- ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION);
- ASSERT_EQ(esplusplayer_set_buffer_size(esplayer_,
- ESPLUSPLAYER_BUFFER_AUDIO_MAX_TIME_SIZE, 3000),
- ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION);
- ASSERT_EQ(esplusplayer_set_buffer_size(esplayer_,
- ESPLUSPLAYER_BUFFER_AUDIO_MIN_BYTE_THRESHOLD, 1024),
- ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION);
- ASSERT_EQ(esplusplayer_set_buffer_size(esplayer_,
- ESPLUSPLAYER_BUFFER_AUDIO_MIN_TIME_THRESHOLD, 1000),
- ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION);
-
+
+ ASSERT_EQ(esplusplayer_set_buffer_size(
+ esplayer_, ESPLUSPLAYER_BUFFER_AUDIO_MAX_BYTE_SIZE, 1024 * 15),
+ ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION);
+ ASSERT_EQ(esplusplayer_set_buffer_size(
+ esplayer_, ESPLUSPLAYER_BUFFER_AUDIO_MAX_TIME_SIZE, 3000),
+ ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION);
+ ASSERT_EQ(esplusplayer_set_buffer_size(
+ esplayer_, ESPLUSPLAYER_BUFFER_AUDIO_MIN_BYTE_THRESHOLD, 1024),
+ ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION);
+ ASSERT_EQ(esplusplayer_set_buffer_size(
+ esplayer_, ESPLUSPLAYER_BUFFER_AUDIO_MIN_TIME_THRESHOLD, 1000),
+ ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION);
+
std::cout << "BasicTest, Play, END" << std::endl;
}