Remove the trick_play_factor in media_info.proto.
- Use the playback_rate instead. Change-Id: I341c39de1c28aacebab5b31aa013bcbbcc2fa9d0
This commit is contained in:
parent
da8877d8a2
commit
27abb208aa
|
@ -102,7 +102,8 @@ class VideoStreamInfo : public StreamInfo {
|
||||||
// example, if the video stream has GOP size of 10 and the trick play factor
|
// example, if the video stream has GOP size of 10 and the trick play factor
|
||||||
// is 3, the key frames are in this trick play stream are [frame_0, frame_30,
|
// is 3, the key frames are in this trick play stream are [frame_0, frame_30,
|
||||||
// frame_60, ...]. Then the playback_rate is 30.
|
// frame_60, ...]. Then the playback_rate is 30.
|
||||||
uint32_t playback_rate_;
|
// Non-zero for trick-play streams.
|
||||||
|
uint32_t playback_rate_ = 0;
|
||||||
|
|
||||||
// Specifies the size of the NAL unit length field. Can be 1, 2 or 4 bytes, or
|
// Specifies the size of the NAL unit length field. Can be 1, 2 or 4 bytes, or
|
||||||
// 0 if the stream is not a NAL structured video stream or if it is an AnnexB
|
// 0 if the stream is not a NAL structured video stream or if it is an AnnexB
|
||||||
|
|
|
@ -102,10 +102,7 @@ void AddVideoInfo(const VideoStreamInfo* video_stream_info,
|
||||||
video_info->set_decoder_config(&codec_config[0], codec_config.size());
|
video_info->set_decoder_config(&codec_config[0], codec_config.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (video_stream_info->trick_play_factor() > 0) {
|
if (video_stream_info->playback_rate() > 0) {
|
||||||
video_info->set_trick_play_factor(video_stream_info->trick_play_factor());
|
|
||||||
CHECK_GT(video_stream_info->playback_rate(), 0u)
|
|
||||||
<< "Max playout rate should be > 0 for trick play streams.";
|
|
||||||
video_info->set_playback_rate(video_stream_info->playback_rate());
|
video_info->set_playback_rate(video_stream_info->playback_rate());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -276,7 +276,7 @@ AdaptationSet* DashIopMpdNotifier::NewAdaptationSet(
|
||||||
new_adaptation_set->AddRole(AdaptationSet::kRoleMain);
|
new_adaptation_set->AddRole(AdaptationSet::kRoleMain);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (media_info.video_info().trick_play_factor() > 0) {
|
if (media_info.video_info().has_playback_rate()) {
|
||||||
uint32_t trick_play_reference_id = 0;
|
uint32_t trick_play_reference_id = 0;
|
||||||
if (!FindOriginalAdaptationSetForTrickPlay(media_info,
|
if (!FindOriginalAdaptationSetForTrickPlay(media_info,
|
||||||
&trick_play_reference_id)) {
|
&trick_play_reference_id)) {
|
||||||
|
@ -294,7 +294,7 @@ bool DashIopMpdNotifier::FindOriginalAdaptationSetForTrickPlay(
|
||||||
const MediaInfo& media_info,
|
const MediaInfo& media_info,
|
||||||
uint32_t* main_adaptation_set_id) {
|
uint32_t* main_adaptation_set_id) {
|
||||||
MediaInfo media_info_no_trickplay = media_info;
|
MediaInfo media_info_no_trickplay = media_info;
|
||||||
media_info_no_trickplay.mutable_video_info()->clear_trick_play_factor();
|
media_info_no_trickplay.mutable_video_info()->clear_playback_rate();
|
||||||
std::string key = GetAdaptationSetKey(media_info_no_trickplay);
|
std::string key = GetAdaptationSetKey(media_info_no_trickplay);
|
||||||
const std::list<AdaptationSet*>& adaptation_sets =
|
const std::list<AdaptationSet*>& adaptation_sets =
|
||||||
adaptation_set_list_map_[key];
|
adaptation_set_list_map_[key];
|
||||||
|
|
|
@ -167,7 +167,6 @@ TEST_F(DashIopMpdNotifierTest, NotifyNewContainerForTrickPlay) {
|
||||||
" frame_duration: 100\n"
|
" frame_duration: 100\n"
|
||||||
" pixel_width: 1\n"
|
" pixel_width: 1\n"
|
||||||
" pixel_height: 1\n"
|
" pixel_height: 1\n"
|
||||||
" trick_play_factor: 2\n"
|
|
||||||
" playback_rate: 10\n"
|
" playback_rate: 10\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
"container_type: 1\n";
|
"container_type: 1\n";
|
||||||
|
|
|
@ -41,12 +41,9 @@ message MediaInfo {
|
||||||
optional uint32 pixel_width = 7;
|
optional uint32 pixel_width = 7;
|
||||||
optional uint32 pixel_height = 8;
|
optional uint32 pixel_height = 8;
|
||||||
|
|
||||||
// trick_play_factor: sample rate of the key frame from the original stream.
|
|
||||||
// e.g., 1 means every key frame, 2 means every two key frames.
|
|
||||||
optional uint32 trick_play_factor = 9;
|
|
||||||
// playback_rate: the playout capability (e.g., 4x, 8x, 16x fast foward) of
|
// playback_rate: the playout capability (e.g., 4x, 8x, 16x fast foward) of
|
||||||
// the trick play stream.
|
// the trick play stream.
|
||||||
optional uint32 playback_rate = 10;
|
optional uint32 playback_rate = 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
message AudioInfo {
|
message AudioInfo {
|
||||||
|
|
|
@ -138,8 +138,7 @@ std::string GetAdaptationSetKey(const MediaInfo& media_info) {
|
||||||
|
|
||||||
// Trick play streams of the same original stream, but possibly with
|
// Trick play streams of the same original stream, but possibly with
|
||||||
// different trick_play_factors, belong to the same trick play AdaptationSet.
|
// different trick_play_factors, belong to the same trick play AdaptationSet.
|
||||||
if (media_info.has_video_info() &&
|
if (media_info.video_info().has_playback_rate()) {
|
||||||
media_info.video_info().trick_play_factor() > 0) {
|
|
||||||
key.append(":trick_play");
|
key.append(":trick_play");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue