Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(596)

Side by Side Diff: media/filters/webvtt_util.h

Issue 23702007: Render inband text tracks in the media pipeline (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: incorporate aaron's comments (11/12) Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 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.
4
5 #ifndef MEDIA_FILTERS_WEBVTT_UTIL_H_
6 #define MEDIA_FILTERS_WEBVTT_UTIL_H_
7
8 #include <vector>
9
10 namespace media {
11
12 // Utility function to create side data item for decoder buffer.
13 template<typename T>
14 static void MakeSideData(T id_begin, T id_end,
15 T settings_begin, T settings_end,
16 std::vector<uint8>* side_data);
17
18 } // namespace media
19
20 template<typename T>
21 inline void media::MakeSideData(
acolwell GONE FROM CHROMIUM 2013/11/20 01:15:24 nit: The implementation should be inside the names
Matthew Heaney (Chromium) 2013/11/20 19:23:16 Done.
22 T id_begin, T id_end,
23 T settings_begin, T settings_end,
24 std::vector<uint8>* side_data) {
25 // The DecoderBuffer only supports a single side data item. In the case of
26 // a WebVTT cue, we can have potentially two side data items. In order to
27 // avoid disrupting DecoderBuffer any more than we need to, we copy both
28 // side data items onto a single one, and terminate each with a NUL marker.
29 side_data->clear();
30 side_data->insert(side_data->end(), id_begin, id_end);
31 side_data->push_back(0);
32 side_data->insert(side_data->end(), settings_begin, settings_end);
33 side_data->push_back(0);
34 }
35
36 #endif // MEDIA_FILTERS_WEBVTT_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698