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

Unified Diff: media/base/decoder_buffer.h

Issue 17408005: Refactored DecoderBuffer to use unix_hacker_style naming. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@localrefactor
Patch Set: Rebased against origin/master Created 7 years, 5 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/android/media_source_player_unittest.cc ('k') | media/base/decoder_buffer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/decoder_buffer.h
diff --git a/media/base/decoder_buffer.h b/media/base/decoder_buffer.h
index 22c0544b31980580dd6e8d29c1608bb56ae44fdb..b799cfa150a68e66671a4ee42705bb77eb253c1a 100644
--- a/media/base/decoder_buffer.h
+++ b/media/base/decoder_buffer.h
@@ -26,7 +26,7 @@ class DecryptConfig;
//
// Also includes decoder specific functionality for decryption.
//
-// NOTE: It is illegal to call any method when IsEndOfStream() is true.
+// NOTE: It is illegal to call any method when end_of_stream() is true.
class MEDIA_EXPORT DecoderBuffer
: public base::RefCountedThreadSafe<DecoderBuffer> {
public:
@@ -56,29 +56,76 @@ class MEDIA_EXPORT DecoderBuffer
// Create a DecoderBuffer indicating we've reached end of stream.
//
- // Calling any method other than IsEndOfStream() on the resulting buffer
+ // Calling any method other than end_of_stream() on the resulting buffer
// is disallowed.
static scoped_refptr<DecoderBuffer> CreateEOSBuffer();
- base::TimeDelta GetTimestamp() const;
- void SetTimestamp(const base::TimeDelta& timestamp);
+ base::TimeDelta timestamp() const {
+ DCHECK(!end_of_stream());
+ return timestamp_;
+ }
- base::TimeDelta GetDuration() const;
- void SetDuration(const base::TimeDelta& duration);
+ void set_timestamp(const base::TimeDelta& timestamp) {
+ DCHECK(!end_of_stream());
+ timestamp_ = timestamp;
+ }
- const uint8* GetData() const;
- uint8* GetWritableData() const;
- int GetDataSize() const;
+ base::TimeDelta duration() const {
+ DCHECK(!end_of_stream());
+ return duration_;
+ }
- const uint8* GetSideData() const;
- int GetSideDataSize() const;
+ void set_duration(const base::TimeDelta& duration) {
+ DCHECK(!end_of_stream());
+ duration_ = duration;
+ }
+
+
+ const uint8* data() const {
+ DCHECK(!end_of_stream());
+ return data_.get();
+ }
+
+ uint8* writable_data() const {
+ DCHECK(!end_of_stream());
+ return data_.get();
+ }
+
scherkus (not reviewing) 2013/07/09 00:57:53 remove extra blank line
Ty Overby 2013/07/12 18:23:50 Done.
+
+ int data_size() const {
+ DCHECK(!end_of_stream());
+ return size_;
+ }
+
+
scherkus (not reviewing) 2013/07/09 00:57:53 remove extra blank line
Ty Overby 2013/07/12 18:23:50 Done.
+ const uint8* side_data() const {
+ DCHECK(!end_of_stream());
+ return side_data_.get();
+ }
+
+ int side_data_size() const {
+ DCHECK(!end_of_stream());
+ return side_data_size_;
+ }
+
scherkus (not reviewing) 2013/07/09 00:57:53 remove extra blank line
Ty Overby 2013/07/12 18:23:50 Done.
+
+ const DecryptConfig* decrypt_config() const {
+ DCHECK(!end_of_stream());
+ return decrypt_config_.get();
+ }
+
+ void set_decrypt_config(scoped_ptr<DecryptConfig> decrypt_config) {
+ DCHECK(!end_of_stream());
+ decrypt_config_ = decrypt_config.Pass();
+ }
- const DecryptConfig* GetDecryptConfig() const;
- void SetDecryptConfig(scoped_ptr<DecryptConfig> decrypt_config);
// If there's no data in this buffer, it represents end of stream.
- bool IsEndOfStream() const;
+ bool end_of_stream() const {
+ return data_ == NULL;
+ }
+
scherkus (not reviewing) 2013/07/09 00:57:53 remove extra blank line
Ty Overby 2013/07/12 18:23:50 Done.
// Returns a human-readable string describing |*this|.
std::string AsHumanReadableString();
« no previous file with comments | « media/base/android/media_source_player_unittest.cc ('k') | media/base/decoder_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698