1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef MEDIA_FILTERS_WEBVTT_UTIL_H_
6 #define MEDIA_FILTERS_WEBVTT_UTIL_H_
12 // Utility function to create side data item for decoder buffer.
14 void MakeSideData(T id_begin
, T id_end
,
15 T settings_begin
, T settings_end
,
16 std::vector
<uint8
>* side_data
) {
17 // The DecoderBuffer only supports a single side data item. In the case of
18 // a WebVTT cue, we can have potentially two side data items. In order to
19 // avoid disrupting DecoderBuffer any more than we need to, we copy both
20 // side data items onto a single one, and terminate each with a NUL marker.
22 side_data
->insert(side_data
->end(), id_begin
, id_end
);
23 side_data
->push_back(0);
24 side_data
->insert(side_data
->end(), settings_begin
, settings_end
);
25 side_data
->push_back(0);
30 #endif // MEDIA_FILTERS_WEBVTT_UTIL_H_