Fix Windows build for trick play handler. (#221)
This commit is contained in:
parent
4891d9a6bf
commit
6347b29ad7
|
@ -126,16 +126,16 @@ std::unique_ptr<StreamData> MediaHandlerTestBase::GetSegmentInfoStreamData(
|
||||||
return stream_data;
|
return stream_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MediaHandlerTestBase::SetUpGraph(int num_inputs,
|
void MediaHandlerTestBase::SetUpGraph(size_t num_inputs,
|
||||||
int num_outputs,
|
size_t num_outputs,
|
||||||
std::shared_ptr<MediaHandler> handler) {
|
std::shared_ptr<MediaHandler> handler) {
|
||||||
// Input handler is not really used anywhere but just to satisfy one input
|
// Input handler is not really used anywhere but just to satisfy one input
|
||||||
// one output restriction for the encryption handler.
|
// one output restriction for the encryption handler.
|
||||||
auto input_handler = std::make_shared<FakeMediaHandler>();
|
auto input_handler = std::make_shared<FakeMediaHandler>();
|
||||||
for (int i = 0; i < num_inputs; ++i)
|
for (size_t i = 0; i < num_inputs; ++i)
|
||||||
ASSERT_OK(input_handler->SetHandler(i, handler));
|
ASSERT_OK(input_handler->SetHandler(i, handler));
|
||||||
// All outputs are routed to |next_handler_|.
|
// All outputs are routed to |next_handler_|.
|
||||||
for (int i = 0; i < num_outputs; ++i)
|
for (size_t i = 0; i < num_outputs; ++i)
|
||||||
ASSERT_OK(handler->SetHandler(i, next_handler_));
|
ASSERT_OK(handler->SetHandler(i, next_handler_));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -112,8 +112,8 @@ class MediaHandlerTestBase : public ::testing::Test {
|
||||||
bool is_subsegment);
|
bool is_subsegment);
|
||||||
|
|
||||||
/// Setup a graph using |handler| with |num_inputs| and |num_outputs|.
|
/// Setup a graph using |handler| with |num_inputs| and |num_outputs|.
|
||||||
void SetUpGraph(int num_inputs,
|
void SetUpGraph(size_t num_inputs,
|
||||||
int num_outputs,
|
size_t num_outputs,
|
||||||
std::shared_ptr<MediaHandler> handler);
|
std::shared_ptr<MediaHandler> handler);
|
||||||
|
|
||||||
/// @return the output stream data vector from handler.
|
/// @return the output stream data vector from handler.
|
||||||
|
|
|
@ -105,7 +105,7 @@ Status TrickPlayHandler::OnFlushRequest(size_t input_stream_index) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Status TrickPlayHandler::ProcessCachedStreamData(
|
Status TrickPlayHandler::ProcessCachedStreamData(
|
||||||
int output_stream_index,
|
size_t output_stream_index,
|
||||||
std::deque<std::shared_ptr<StreamData>>* cached_stream_data) {
|
std::deque<std::shared_ptr<StreamData>>* cached_stream_data) {
|
||||||
while (!cached_stream_data->empty()) {
|
while (!cached_stream_data->empty()) {
|
||||||
Status status =
|
Status status =
|
||||||
|
@ -119,7 +119,7 @@ Status TrickPlayHandler::ProcessCachedStreamData(
|
||||||
}
|
}
|
||||||
|
|
||||||
Status TrickPlayHandler::ProcessOneStreamData(
|
Status TrickPlayHandler::ProcessOneStreamData(
|
||||||
int output_stream_index,
|
size_t output_stream_index,
|
||||||
const std::shared_ptr<StreamData>& stream_data) {
|
const std::shared_ptr<StreamData>& stream_data) {
|
||||||
uint32_t trick_play_rate =
|
uint32_t trick_play_rate =
|
||||||
trick_play_options_.trick_play_rates[output_stream_index - 1];
|
trick_play_options_.trick_play_rates[output_stream_index - 1];
|
||||||
|
|
|
@ -50,11 +50,8 @@ class TrickPlayHandler : public MediaHandler {
|
||||||
|
|
||||||
// Process the cached stream data for one trick play stream.
|
// Process the cached stream data for one trick play stream.
|
||||||
// The cached data is dispatched to the |output_stream_index|.
|
// The cached data is dispatched to the |output_stream_index|.
|
||||||
// The |current_dts| is for updating the duration of key frames,
|
|
||||||
// so that there is no gap between consecutive key frames. When
|
|
||||||
// |current_dts| = -1, the original duration of the key frame is used.
|
|
||||||
Status ProcessCachedStreamData(
|
Status ProcessCachedStreamData(
|
||||||
int output_stream_index,
|
size_t output_stream_index,
|
||||||
std::deque<std::shared_ptr<StreamData>>* cached_stream_data);
|
std::deque<std::shared_ptr<StreamData>>* cached_stream_data);
|
||||||
|
|
||||||
// Process a single stream data. Depending on the stream data type, some
|
// Process a single stream data. Depending on the stream data type, some
|
||||||
|
@ -62,7 +59,7 @@ class TrickPlayHandler : public MediaHandler {
|
||||||
// Decoding timestamp for current key media sample. It is used for calculating
|
// Decoding timestamp for current key media sample. It is used for calculating
|
||||||
// the duration of previous key media sample, to make sure there is no gap
|
// the duration of previous key media sample, to make sure there is no gap
|
||||||
// between two key media samples.
|
// between two key media samples.
|
||||||
Status ProcessOneStreamData(int output_stream_index,
|
Status ProcessOneStreamData(size_t output_stream_index,
|
||||||
const std::shared_ptr<StreamData>& stream_data);
|
const std::shared_ptr<StreamData>& stream_data);
|
||||||
|
|
||||||
const TrickPlayOptions trick_play_options_;
|
const TrickPlayOptions trick_play_options_;
|
||||||
|
|
Loading…
Reference in New Issue