Pepper_37_C++_interfaces
source_buffer_samsung.h
Go to the documentation of this file.
1 // Copyright 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 PPAPI_CPP_SAMSUNG_SOURCE_BUFFER_SAMSUNG_H_
6 #define PPAPI_CPP_SAMSUNG_SOURCE_BUFFER_SAMSUNG_H_
7 
8 #include "ppapi/c/pp_array_output.h"
9 #include "ppapi/c/samsung/pp_media_source_samsung.h"
10 #include "ppapi/cpp/completion_callback.h"
11 #include "ppapi/cpp/resource.h"
12 #include "ppapi/cpp/var.h"
13 
14 namespace pp {
15 
16 class InstanceHandle;
17 
18 /// Interface used by PNaCl application to provide chunks of multimedia data
19 /// to the platform. Those chunks will be decoded and played by the platform.
20 ///
21 /// API is similar to one defined in JavaScript's Media Source Extensions
23  public:
24  // Creates an is_null() SourceBuffer object.
26 
27  // Creates a SourceBuffer from MediaSource_Samsung::AddSource call
28  explicit SourceBuffer_Samsung(const Resource& resource);
29  explicit SourceBuffer_Samsung(PP_Resource resource);
30  explicit SourceBuffer_Samsung(PassRef, PP_Resource resource);
31 
32  /// Destructor
33  virtual ~SourceBuffer_Samsung() {}
34 
35  /// PPB_SourceBuffer_Samsung API
36 
37  /// Checks if given source is active i.e. it contains video, audio or
38  /// text (subtitle) track being played. The execution may resume from the |callback|.
40 
41  /// Appends data to given buffer.
42  /// Execution is confirmed by a call to |callback|.
43  int32_t Append(const void* data, uint32_t bytes_to_append, const CompletionCallback& callback);
44 
45  /// Aborts given data source
46  /// Execution is confirmed by a call to |callback|.
47  int32_t Abort(const CompletionCallback& callback);
48 
49  /// Sets a time offset (in microseconds) to be applied to subsequent
50  /// buffers appended to the given buffer. The execution may resume from the |callback|.
51  int32_t SetTimestampOffset(PP_MicrosecondsDelta offset, const CompletionCallback& callback);
52 
53  /// Gets offset in microseconds of selected stream. The execution may resume from the |callback|.
55 
56  /// ReadS ranges of buffered media stream. The execution may resume from the |callback|.
57  int32_t ReadTimeRanges(const CompletionCallbackWithOutput< std::vector<PP_TimeRange> >& callback);
58 
59 };
60 
61 } // namespace pp
62 
63 #endif // PPAPI_CPP_SAMSUNG_SOURCE_BUFFER_SAMSUNG_H_
int32_t ReadTimeRanges(const CompletionCallbackWithOutput< std::vector< PP_TimeRange > > &callback)
ReadS ranges of buffered media stream. The execution may resume from the |callback|.
int32_t Abort(const CompletionCallback &callback)
int32_t IsSourceActive(const CompletionCallbackWithOutput< PP_Bool > &callback)
PPB_SourceBuffer_Samsung API.
PassRef
Definition: pass_ref.h:17
int32_t Append(const void *data, uint32_t bytes_to_append, const CompletionCallback &callback)
int32_t SetTimestampOffset(PP_MicrosecondsDelta offset, const CompletionCallback &callback)
int32_t GetTimestampOffset(const CompletionCallbackWithOutput< PP_MicrosecondsDelta > &callback)
Gets offset in microseconds of selected stream. The execution may resume from the |callback|...
A reference counted module resource.
Definition: resource.h:20
virtual ~SourceBuffer_Samsung()
Destructor.