Remove the trick_play_factor in media_info.proto.

- Use the playback_rate instead.

Change-Id: I341c39de1c28aacebab5b31aa013bcbbcc2fa9d0
This commit is contained in:
Haoming Chen 2017-05-16 09:59:52 -07:00
parent da8877d8a2
commit 27abb208aa
6 changed files with 7 additions and 14 deletions

View File

@ -102,7 +102,8 @@ class VideoStreamInfo : public StreamInfo {
// 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,
// 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
// 0 if the stream is not a NAL structured video stream or if it is an AnnexB

View File

@ -102,10 +102,7 @@ void AddVideoInfo(const VideoStreamInfo* video_stream_info,
video_info->set_decoder_config(&codec_config[0], codec_config.size());
}
if (video_stream_info->trick_play_factor() > 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.";
if (video_stream_info->playback_rate() > 0) {
video_info->set_playback_rate(video_stream_info->playback_rate());
}
}

View File

@ -276,7 +276,7 @@ AdaptationSet* DashIopMpdNotifier::NewAdaptationSet(
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;
if (!FindOriginalAdaptationSetForTrickPlay(media_info,
&trick_play_reference_id)) {
@ -294,7 +294,7 @@ bool DashIopMpdNotifier::FindOriginalAdaptationSetForTrickPlay(
const MediaInfo& media_info,
uint32_t* main_adaptation_set_id) {
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);
const std::list<AdaptationSet*>& adaptation_sets =
adaptation_set_list_map_[key];

View File

@ -167,7 +167,6 @@ TEST_F(DashIopMpdNotifierTest, NotifyNewContainerForTrickPlay) {
" frame_duration: 100\n"
" pixel_width: 1\n"
" pixel_height: 1\n"
" trick_play_factor: 2\n"
" playback_rate: 10\n"
"}\n"
"container_type: 1\n";

View File

@ -41,12 +41,9 @@ message MediaInfo {
optional uint32 pixel_width = 7;
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
// the trick play stream.
optional uint32 playback_rate = 10;
optional uint32 playback_rate = 9;
}
message AudioInfo {

View File

@ -138,8 +138,7 @@ std::string GetAdaptationSetKey(const MediaInfo& media_info) {
// Trick play streams of the same original stream, but possibly with
// different trick_play_factors, belong to the same trick play AdaptationSet.
if (media_info.has_video_info() &&
media_info.video_info().trick_play_factor() > 0) {
if (media_info.video_info().has_playback_rate()) {
key.append(":trick_play");
}