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

Unified 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: fix compile errors 11/21 #6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/source_buffer_stream.cc ('k') | media/media.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/webvtt_util.h
diff --git a/media/filters/webvtt_util.h b/media/filters/webvtt_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..5c4e6280eb549c48e66843f343202cdac6a57090
--- /dev/null
+++ b/media/filters/webvtt_util.h
@@ -0,0 +1,30 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MEDIA_FILTERS_WEBVTT_UTIL_H_
+#define MEDIA_FILTERS_WEBVTT_UTIL_H_
+
+#include <vector>
+
+namespace media {
+
+// Utility function to create side data item for decoder buffer.
+template<typename T>
+void MakeSideData(T id_begin, T id_end,
+ T settings_begin, T settings_end,
+ std::vector<uint8>* side_data) {
+ // The DecoderBuffer only supports a single side data item. In the case of
+ // a WebVTT cue, we can have potentially two side data items. In order to
+ // avoid disrupting DecoderBuffer any more than we need to, we copy both
+ // side data items onto a single one, and terminate each with a NUL marker.
+ side_data->clear();
+ side_data->insert(side_data->end(), id_begin, id_end);
+ side_data->push_back(0);
+ side_data->insert(side_data->end(), settings_begin, settings_end);
+ side_data->push_back(0);
+}
+
+} // namespace media
+
+#endif // MEDIA_FILTERS_WEBVTT_UTIL_H_
« no previous file with comments | « media/filters/source_buffer_stream.cc ('k') | media/media.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698