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

Unified Diff: services/media/framework/packet.h

Issue 1814553002: Motown: Improvements to packet definition (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Added a comment. Created 4 years, 9 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 | « services/media/framework/formatting.cc ('k') | services/media/framework/packet.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/media/framework/packet.h
diff --git a/services/media/framework/packet.h b/services/media/framework/packet.h
index d89d68ba1d6067f7e79028627490ac52240c26b9..952383ce54a764f0ebc9be394df4f7e5b445c925 100644
--- a/services/media/framework/packet.h
+++ b/services/media/framework/packet.h
@@ -32,14 +32,12 @@ typedef std::unique_ptr<Packet, PacketDeleter> PacketPtr;
// 2) The relationship to the allocator could be clearer.
class Packet {
public:
- static const int64_t kUnknownPresentationTime =
- std::numeric_limits<int64_t>::min();
+ static const int64_t kUnknownPts = std::numeric_limits<int64_t>::min();
// Creates a packet. If size is 0, payload must be nullptr and vice-versa.
// If payload is not nullptr, an allocator must be provided.
static PacketPtr Create(
- int64_t presentation_time,
- uint64_t duration,
+ int64_t pts,
bool end_of_stream,
size_t size,
void* payload,
@@ -49,30 +47,39 @@ class Packet {
// No allocator is provided, and the payload will not be released when the
// packet is released.
static PacketPtr CreateNoAllocator(
- int64_t presentation_time,
- uint64_t duration,
+ int64_t pts,
bool end_of_stream,
size_t size,
void* payload);
// Creates an end-of-stream packet with no payload.
- static PacketPtr CreateEndOfStream(int64_t presentation_time);
+ static PacketPtr CreateEndOfStream(int64_t pts);
- virtual int64_t presentation_time() const = 0;
+ int64_t pts() const { return pts_; }
- virtual uint64_t duration() const = 0;
+ bool end_of_stream() const { return end_of_stream_; }
- virtual bool end_of_stream() const = 0;
+ size_t size() const { return size_; }
- virtual size_t size() const = 0;
-
- virtual void* payload() const = 0;
+ void* payload() const { return payload_; }
protected:
+ Packet(
+ int64_t pts,
+ bool end_of_stream,
+ size_t size,
+ void* payload);
+
virtual ~Packet() {}
virtual void Release() = 0;
+ private:
+ int64_t pts_;
+ bool end_of_stream_;
+ size_t size_;
+ void* payload_;
+
friend PacketDeleter;
};
« no previous file with comments | « services/media/framework/formatting.cc ('k') | services/media/framework/packet.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698