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

Unified Diff: media/formats/webm/opus_packet_builder.h

Issue 883403002: Parsing of encoded duration for unencrypted opus streams. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor fix for log line. Created 5 years, 10 months 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/base/media_log.h ('k') | media/formats/webm/opus_packet_builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/formats/webm/opus_packet_builder.h
diff --git a/media/formats/webm/opus_packet_builder.h b/media/formats/webm/opus_packet_builder.h
new file mode 100644
index 0000000000000000000000000000000000000000..af76b49a398cd564003ffa41533cc3c4b3270bec
--- /dev/null
+++ b/media/formats/webm/opus_packet_builder.h
@@ -0,0 +1,43 @@
+// Copyright (c) 2015 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_FORMATS_WEBM_OPUS_PACKET_BUILDER_H_
+#define MEDIA_FORMATS_WEBM_OPUS_PACKET_BUILDER_H_
+
+#include <vector>
+
+#include "base/memory/scoped_ptr.h"
+#include "base/memory/scoped_vector.h"
+
+namespace media {
+
+// From Opus RFC. See https://tools.ietf.org/html/rfc6716#page-14
+enum OpusConstants {
+ kNumPossibleOpusConfigs = 32,
+ kMinOpusPacketFrameCount = 1,
+ kMaxOpusPacketFrameCount = 48
+};
+
+class OpusPacket {
+ public:
+ OpusPacket(uint8_t config, uint8_t frame_count, bool is_VBR);
+ ~OpusPacket();
+
+ const uint8_t* data() const;
+ int size() const;
+ double duration_ms() const;
+
+ private:
+ std::vector<uint8_t> data_;
+ double duration_ms_;
+
+ DISALLOW_COPY_AND_ASSIGN(OpusPacket);
+};
+
+// Builds an exhaustive collection of Opus packet configurations.
+ScopedVector<OpusPacket> BuildAllOpusPackets();
+
+} // namespace media
+
+#endif // MEDIA_FORMATS_WEBM_OPUS_PACKET_BUILDER_H_
« no previous file with comments | « media/base/media_log.h ('k') | media/formats/webm/opus_packet_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698