Pepper_47_C_interfaces
ppb_media_data_source_samsung.h
Go to the documentation of this file.
1 /* Copyright (c) 2016 Samsung Electronics. All rights reserved.
2  */
3 
4 /* From samsung/ppb_media_data_source_samsung.idl,
5  * modified Wed Mar 30 10:21:58 2016.
6  */
7 
8 #ifndef PPAPI_C_SAMSUNG_PPB_MEDIA_DATA_SOURCE_SAMSUNG_H_
9 #define PPAPI_C_SAMSUNG_PPB_MEDIA_DATA_SOURCE_SAMSUNG_H_
10 
11 #include "ppapi/c/pp_bool.h"
13 #include "ppapi/c/pp_instance.h"
14 #include "ppapi/c/pp_macros.h"
15 #include "ppapi/c/pp_resource.h"
16 #include "ppapi/c/pp_size.h"
17 #include "ppapi/c/pp_stdint.h"
18 #include "ppapi/c/pp_time.h"
19 #include "ppapi/c/pp_var.h"
24 
25 #define PPB_MEDIADATASOURCE_SAMSUNG_INTERFACE_1_0 \
26  "PPB_MediaDataSource_Samsung;1.0"
27 #define PPB_MEDIADATASOURCE_SAMSUNG_INTERFACE \
28  PPB_MEDIADATASOURCE_SAMSUNG_INTERFACE_1_0
29 
30 #define PPB_URLDATASOURCE_SAMSUNG_INTERFACE_1_0 "PPB_URLDataSource_Samsung;1.0"
31 #define PPB_URLDATASOURCE_SAMSUNG_INTERFACE \
32  PPB_URLDATASOURCE_SAMSUNG_INTERFACE_1_0
33 
34 #define PPB_ESDATASOURCE_SAMSUNG_INTERFACE_1_0 "PPB_ESDataSource_Samsung;1.0"
35 #define PPB_ESDATASOURCE_SAMSUNG_INTERFACE \
36  PPB_ESDATASOURCE_SAMSUNG_INTERFACE_1_0
37 
38 #define PPB_ELEMENTARYSTREAM_SAMSUNG_INTERFACE_1_0 \
39  "PPB_ElementaryStream_Samsung;1.0"
40 #define PPB_ELEMENTARYSTREAM_SAMSUNG_INTERFACE \
41  PPB_ELEMENTARYSTREAM_SAMSUNG_INTERFACE_1_0
42 
43 #define PPB_AUDIOELEMENTARYSTREAM_SAMSUNG_INTERFACE_1_0 \
44  "PPB_AudioElementaryStream_Samsung;1.0"
45 #define PPB_AUDIOELEMENTARYSTREAM_SAMSUNG_INTERFACE \
46  PPB_AUDIOELEMENTARYSTREAM_SAMSUNG_INTERFACE_1_0
47 
48 #define PPB_VIDEOELEMENTARYSTREAM_SAMSUNG_INTERFACE_1_0 \
49  "PPB_VideoElementaryStream_Samsung;1.0"
50 #define PPB_VIDEOELEMENTARYSTREAM_SAMSUNG_INTERFACE \
51  PPB_VIDEOELEMENTARYSTREAM_SAMSUNG_INTERFACE_1_0
52 
53 /**
54  * @file
55  * This file defines the Media Data Sources interfaces, which provide
56  * abilities to feed player with media clip data.
57  *
58  * Part of Pepper Media Player interfaces (Samsung's extension).
59  * See See comments in ppb_media_player_samsung for general overview.
60  *
61  * Data Sources:
62  * - <code>PPB_MediaDataSource_Samusng</code> is an abstract interface
63  * representing data source.
64  * - <code>PPB_URLDataSource_Samusng</code> is data source which opens
65  * stream given by URL. It is derived from
66  * <code>PPB_DataSource_Samusng</code>.
67  * - <code>PPB_ESDataSource_Samusng</code> is data source allowing to provide
68  * Elementary Streams from Pepper/PNaCl module. Using this player the module
69  * can create buffers accepting Elementary Stream packets.
70  * Those buffers are derived from <code>PPB_ElementaryStream_Samusng</code>
71  * interface.
72  *
73  * Relationship can be represented as follows:
74  * PPB_MediaDataSource_Samusng [base]
75  * |
76  * |- PPB_URLDataSource_Samusng [derived]
77  * |- PPB_ESDataSource_Samusng [derived] consists of set of
78  * PPB_ElementaryStream_Samusng
79  *
80  * - <code>PPB_ElementaryStream_Samusng</code> is basic interface providing
81  * methods to submit Elementary Stream packets to the player. Those packets
82  * might be optionally encrypted. Inheriting interfaces must provide methods
83  * necessary to initialize decoder handling elementary stream of given type
84  * (audio or video).
85  * - <code>PPB_AudioElementaryStream_Samsung</code> is interface allowing
86  * application to provide packets comprising audio Elementary Stream.
87  * - <code>PPB_VideoElementaryStream_Samsung</code> is interface allowing
88  * application to provide packets comprising video Elementary Stream.
89  *
90  * Relationship can be represented as follows:
91  * PPB_ElementaryStream_Samsung [base]
92  * |
93  * |- PPB_AudioElementaryStream_Samsung [derived]
94  * |- PPB_VideoElementaryStream_Samsung [derived]
95  */
96 
97 
98 /**
99  * @addtogroup Interfaces
100  * @{
101  */
102 /**
103  * Interface representing abstract Data Source.
104  */
106  /**
107  * Determines if the given resource is a media data source.
108  *
109  * @param[in] resource A <code>PP_Resource</code> identifying a resource.
110  *
111  * @return <code>PP_TRUE</code> if the resource is a
112  * <code>PPB_MediaDataSource_Samsung</code>, <code>PP_FALSE</code>
113  * if the resource is invalid or some other type.
114  */
116 };
117 
119 
120 /**
121  * Data Source handling media passed as URLs in Create method,
122  * derives from PPB_MediaDataSource_Samsung.
123  *
124  * After creation data source can be attached to the player.
125  * When attaching to the player passed URL is validated and buffering starts.
126  */
128  /**
129  * Creates a new URL data source resource.
130  *
131  * @param[in] instance A <code>PP_Instance</code> identifying the instance
132  * with the URL data source.
133  * @param[in] url An URL identifying media clip fetched by data source.
134  *
135  * @return A <code>PP_Resource</code> corresponding to a URL data source if
136  * successful or 0 otherwise.
137  */
138  PP_Resource (*Create)(PP_Instance instance, const char* url);
139  /**
140  * Determines if the given resource is an URL data source.
141  *
142  * @param[in] resource A <code>PP_Resource</code> identifying a resource.
143  *
144  * @return <code>PP_TRUE</code> if the resource is a
145  * <code>PPB_URLDataSource_Samsung</code>, <code>PP_FALSE</code>
146  * if the resource is invalid or some other type.
147  */
149  /**
150  * Gets the value for specific Feature in the HTTP, MMS & Streaming Engine
151  * (Smooth Streaming, HLS, DASH, DivX Plus Streaming, Widevine).
152  *
153  * @param[in] resource A <code>PP_Resource</code> identifying a resource.
154  * @param[in] type A <code>PP_StreamingProperty</code> to get
155  * @param[out] value Value of the property, see description of
156  * <code>PP_StreamingProperty</code> what is requested format.
157  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
158  * completion.
159  *
160  * @return PP_OK on success, otherwise an error code from
161  * <code>pp_errors.h</code>.
162  */
163  int32_t (*GetStreamingProperty)(PP_Resource resource,
165  struct PP_Var* value,
166  struct PP_CompletionCallback callback);
167  /**
168  * Sets the value for specific Feature in the HTTP, MMS & Streaming Engine
169  * (Smooth Streaming, HLS, DASH, DivX Plus Streaming, Widevine).
170  *
171  * When special setting is required in Streaming Engine for the
172  * Start itrate setting or specific Content Protection (CP),
173  * the CUSTOM_MESSAGE Property can be set.
174  *
175  * @param[in] resource A <code>PP_Resource</code> identifying a resource.
176  * @param[in] type A <code>PP_StreamingProperty</code> to set
177  * @param[in] value New value of the property, see description of
178  * <code>PP_StreamingProperty</code> what is requested format.
179  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
180  * completion.
181  *
182  * @return PP_OK on success, otherwise an error code from
183  * <code>pp_errors.h</code>.
184  */
185  int32_t (*SetStreamingProperty)(PP_Resource resource,
187  struct PP_Var value,
188  struct PP_CompletionCallback callback);
189 };
190 
192 
193 /**
194  * Data source handling appends of Elementary Streams,
195  * derives from PPB_MediaDataSource_Samsung.
196  *
197  * It is a container for Elementary Streams (audio/video/...) and there can
198  * be at most one stream of given type (see
199  * <code>PP_ElementaryStream_Type_Samsung</code>).
200  *
201  * Basic usage (playback of clip containing audio and video):
202  * 1. Create ESDataSource resource using <code>Create<code>.
203  * 2. Add audio stream using <code>AddStream<code> with
204  * <code>PP_ELEMENTARYSTREAM_TYPE_SAMSUNG_AUDIO<code> type.
205  * 3. Configure audio stream, by setting codec, sampling rate, channels and
206  * other necessary information.
207  * 4. Call <code>PPB_ElementaryStream_Samsung.InitializeDone</code> to confirm
208  * the configuration
209  * 5. Add video stream using <code>AddStream<code> with
210  * <code>PP_ELEMENTARYSTREAM_TYPE_SAMSUNG_VIDEO<code> type.
211  * 6. Configure video stream, by setting codec, frame rate, resolution and
212  * other necessary information.
213  * 7. Call <code>PPB_ElementaryStream_Samsung.InitializeDone</code> to confirm
214  * the configuration.
215  * 8. Attach data source to the player by calling
216  * <code>PPB_MediaPlayer_Samsung.AttachMediaSource</code>.
217  * 9. Download and append Elementary Stream audio and video packets
218  * by calling <code>PPB_ElementaryStream_Samsung.AppendPacket</code>
219  * 10. Signalize end of stream (clip) by calling <code>SetEndOfStream</code>
220  * 11. Detach data source from the player by calling
221  * <code>PPB_MediaPlayer_Samsung.AttachMediaSource</code> with
222  * <code>NULL</code> resource.
223  */
225  /**
226  * Creates a new ES data source resource.
227  *
228  * @param[in] instance A <code>PP_Instance</code> identifying the instance
229  * with the ES data source.
230  *
231  * @return A <code>PP_Resource</code> corresponding to a media player if
232  * successful or 0 otherwise.
233  */
235  /**
236  * Determines if the given resource is a ES Data Source.
237  *
238  * @param[in] resource A <code>PP_Resource</code> identifying a resource.
239  *
240  * @return <code>PP_TRUE</code> if the resource is a
241  * <code>PPB_ESDataSource_Samsung</code>, <code>PP_FALSE</code>
242  * if the resource is invalid or some other type.
243  */
245  /**
246  * Factory method which adds stream of given type to the data source.
247  *
248  * This data source can handle at most one buffer of given type, so calling
249  * multiple times this method with the same buffer type will return the
250  * same resource as all previous calls. Specified listener will be ignored
251  * if buffer is already created.
252  *
253  * Listener methods will be called in the same thread as was this method
254  * invoked.
255  *
256  * @param[in] data_source A <code>PP_Resource</code> identifying the
257  * ES data source to which add new stream.
258  * @param[in] stream_type A <code>PP_ElementaryStream_Type_Samsung</code>
259  * identifying the stream type which will be added.
260  * @param[in] listener A <code>PPP_ElementaryStreamListener_Samsung</code>
261  * listener which is required to notify application about data related events.
262  * Cannot be NULL.
263  * @param[in] user_data A pointer to user data which will be passed
264  * to the listeners during method invocation (optional).
265  * @param[out] stream A <code>PP_Resource</code> identifying the
266  * added stream of requested type.
267  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
268  * completion.
269  *
270  * @return PP_OK on success, otherwise an error code from
271  * <code>pp_errors.h</code>.
272  */
273  int32_t (*AddStream)(
274  PP_Resource data_source,
276  const struct PPP_ElementaryStreamListener_Samsung_1_0* listener,
277  void* user_data,
278  PP_Resource* stream,
279  struct PP_CompletionCallback callback);
280  /**
281  * Sets duration of the whole media stream/container/clip.
282  *
283  * @param[in] data_source A <code>PP_Resource</code> identifying the
284  * ES data source to which add new stream.
285  * @param[in] duration A duration of played media.
286  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
287  * completion.
288  *
289  * @return PP_OK on success, otherwise an error code from
290  * <code>pp_errors.h</code>.
291  */
292  int32_t (*SetDuration)(PP_Resource data_source,
293  PP_TimeDelta duration,
294  struct PP_CompletionCallback callback);
295  /**
296  * Signalizes end of the whole stream/container/clip.
297  *
298  * @param[in] data_source A <code>PP_Resource</code> identifying the
299  * ES data source which has ended.
300  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
301  * completion.
302  *
303  * @return PP_OK on success, otherwise an error code from
304  * <code>pp_errors.h</code>.
305  */
306  int32_t (*SetEndOfStream)(PP_Resource data_source,
307  struct PP_CompletionCallback callback);
308 };
309 
311 
312 /**
313  * Interface representing common functionalities of elementary streams.
314  *
315  * Basic usage:
316  * 1. Crate stream by calling <code>PPB_ESDataSource_Samsung.AddStream</code>
317  * 2. Initialize buffer specific information (audio/video config)
318  * 3. Call <code>InitializeDone</code>
319  * 5. Attach Data Source to the player
320  * 6. Appends Elementary Stream packets by calling <code>AppendPacket</code>
321  * 7. Signalize end of stream (clip) by calling
322  * <code>PPB_ESDataSource_Samsung.SetEndOfStream</code>
323  */
325  /**
326  * Determines if the given resource is a media player.
327  *
328  * @param[in] resource A <code>PP_Resource</code> identifying a resource.
329  *
330  * @return <code>PP_TRUE</code> if the resource is a
331  * <code>PPB_MediaPlayer_Samsung</code>, <code>PP_FALSE</code>
332  * if the resource is invalid or some other type.
333  */
335  /**
336  * Retrieves stream type represented by this resource.
337  *
338  * @param[in] resource A <code>PP_Resource</code> identifying a resource.
339  *
340  * @return <code>PP_ElementaryStream_Type_Samsung</code> represented by this
341  * resource or <code>PP_ELEMENTARYSTREAM_TYPE_SAMSUNG_UNKNOWN</code> when
342  * this resource doesn't represent any stream type.
343  */
345  /**
346  * Call this method to confirm new/updated buffer config. This method will
347  * return PP_OK if set buffer config is valid or one of the error codes from
348  * <code>pp_errors.h</code> otherwise.
349  *
350  * @param[in] stream A <code>PP_Resource</code> identifying the
351  * elementary stream.
352  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
353  * completion.
354  *
355  * @return PP_OK on success, otherwise an error code from
356  * <code>pp_errors.h</code>.
357  * Method returns <code>PP_ERROR_BADARGUMENT</code> when stream configuration
358  * is invalid.
359  */
360  int32_t (*InitializeDone)(PP_Resource stream,
361  struct PP_CompletionCallback callback);
362  /**
363  * Appends Elementary Stream packet.
364  *
365  * Before appending any packet to the buffer, it must be properly configured
366  * (see <code>InitializeDone</code>).
367  *
368  * @param[in] stream A <code>PP_Resource</code> identifying the
369  * elementary stream.
370  * @param[in] packet A <code>PP_ESPacket</code> containing Elementary Stream
371  * packet data and metadata.
372  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
373  * completion.
374  *
375  * @return PP_OK on success, otherwise an error code from
376  * <code>pp_errors.h</code>.
377  * Returns PP_ERROR_FAILED if InitializeDone() has not successfully completed.
378  * Returns PP_ERROR_NOQUOTA if internal buffer is full.
379  */
380  int32_t (*AppendPacket)(PP_Resource stream,
381  const struct PP_ESPacket* packet,
382  struct PP_CompletionCallback callback);
383  /**
384  * Appends Elementary Stream encrypted packet.
385  *
386  * Before appending any packet to the buffer, it must be properly configured
387  * (see <code>InitializeDone</code>).
388  *
389  * @param[in] stream A <code>PP_Resource</code> identifying the
390  * elementary stream.
391  * @param[in] packet A <code>PP_ESPacket</code> containing Elementary Stream
392  * packet data and metadata.
393  * @param[in] encryption_info A <code>PP_ESPacketEncryptionInfo</code>
394  * containing packet encryption description.
395  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
396  * completion.
397  *
398  * @return PP_OK on success, otherwise an error code from
399  * <code>pp_errors.h</code>.
400  * Returns PP_ERROR_FAILED if InitializeDone() has not successfully completed.
401  * Returns PP_ERROR_NOQUOTA if internal buffer is full.
402  */
404  PP_Resource stream,
405  const struct PP_ESPacket* packet,
406  const struct PP_ESPacketEncryptionInfo* encryption_info,
407  struct PP_CompletionCallback callback);
408  /**
409  * Flushes all appended, but not decoded or rendered packets to this buffer.
410  * This method is usually called during seek operations.
411  *
412  * @param[in] stream A <code>PP_Resource</code> identifying the
413  * elementary stream.
414  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
415  * completion.
416  *
417  * @return PP_OK on success, otherwise an error code from
418  * <code>pp_errors.h</code>.
419  * Returns PP_ERROR_FAILED if InitializeDone() has not successfully completed.
420  */
421  int32_t (*Flush)(PP_Resource stream, struct PP_CompletionCallback callback);
422  /**
423  * Found DRM system initialization metadata. |type| describes type
424  * of the initialization data |init_data| associated with the stream.
425  *
426  * @param[in] stream A <code>PP_Resource</code> identifying the
427  * elementary stream.
428  * @param[in] type A string describing type of an |init_data|.
429  * Examples:
430  * - "cenc:pssh" - |init_data| will contain PSSH box as
431  * described by Common Encryption specifiacation
432  * - "mspr:pro" - |init_data| will contain Microsoft
433  * PlayReady Object Header (PRO).
434  * @param[in] init_data_size A size of DRM specific |init_data| buffer
435  * @param[in] init_data A buffer containing DRM system initialization data.
436  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
437  * completion.
438  *
439  * @return PP_OK on success, otherwise an error code from
440  * <code>pp_errors.h</code>.
441  */
442  int32_t (*SetDRMInitData)(PP_Resource stream,
443  const char* type,
444  uint32_t init_data_size,
445  const void* init_data,
446  struct PP_CompletionCallback callback);
447 };
448 
450 
451 /**
452  * Interface representing an audio elementary stream and containing methods
453  * to set audio codec specific configuration.
454  *
455  * All pending configuration changes/initialization must be confirmed
456  * by call to <code>PPB_ElementaryStream_Samsung.InitializeDone</code>.
457  *
458  * All getters return last set configuration, which might be not confirmed yet.
459  */
461  /**
462  * Determines if the given resource is an audio elementary stream.
463  *
464  * @param[in] resource A <code>PP_Resource</code> identifying a resource.
465  *
466  * @return <code>PP_TRUE</code> if the resource is a
467  * <code>PPB_AudioElementaryStream_Samsung</code>, <code>PP_FALSE</code>
468  * if the resource is invalid or some other type.
469  */
471  /**
472  * Retrieves current audio codec type.
473  *
474  * @param[in] stream A <code>PP_Resource</code> identifying the audio
475  * elementary stream.
476  *
477  * @return Current audio codec type.
478  */
480  /**
481  * Sets new audio codec type.
482  *
483  * @param[in] stream A <code>PP_Resource</code> identifying the audio
484  * elementary stream.
485  * @param[in] audio_codec New audio codec type.
486  */
488  PP_AudioCodec_Type_Samsung audio_codec);
489  /**
490  * Retrieves current audio codec profile.
491  *
492  * @param[in] stream A <code>PP_Resource</code> identifying the audio
493  * elementary stream.
494  *
495  * @return Current audio codec profile.
496  */
498  /**
499  * Sets new audio codec profile.
500  *
501  * @param[in] stream A <code>PP_Resource</code> identifying the audio
502  * elementary stream.
503  * @param[in] profile New audio codec profile.
504  */
507  /**
508  * Retrieves current audio sample format.
509  *
510  * @param[in] stream A <code>PP_Resource</code> identifying the audio
511  * elementary stream.
512  *
513  * @return Current audio sample format.
514  */
516  /**
517  * Sets new audio sample format.
518  *
519  * @param[in] stream A <code>PP_Resource</code> identifying the audio
520  * elementary stream.
521  * @param[in] sample_format New audio sample format.
522  */
523  void (*SetSampleFormat)(PP_Resource stream,
524  PP_SampleFormat_Samsung sample_format);
525  /**
526  * Retrieves current audio channel layout.
527  *
528  * @param[in] stream A <code>PP_Resource</code> identifying the audio
529  * elementary stream.
530  *
531  * @return current audio channel layout.
532  */
534  /**
535  * Sets new audio channel layout.
536  *
537  * @param[in] stream A <code>PP_Resource</code> identifying the audio
538  * elementary stream.
539  * @param[in] audio_codec New audio channel layout.
540  */
542  PP_ChannelLayout_Samsung channel_layout);
543  /**
544  * Retrieves how many bits are used to represent audio sample
545  * per each channel.
546  *
547  * @param[in] stream A <code>PP_Resource</code> identifying the audio
548  * elementary stream.
549  *
550  * @return How many bits are used to represent audio sample per each channel.
551  */
552  int32_t (*GetBitsPerChannel)(PP_Resource stream);
553  /**
554  * Sets how many bits are used to represent audio sample per each channel.
555  *
556  * @param[in] stream A <code>PP_Resource</code> identifying the audio
557  * elementary stream.
558  * @param[in] bits_per_channel Value representing how many bits are used
559  * to represent audio sample per each channel.
560  */
561  void (*SetBitsPerChannel)(PP_Resource stream, int32_t bits_per_channel);
562  /**
563  * Retrieves how many audio samples were recorded per second (sample rate).
564  *
565  * @param[in] stream A <code>PP_Resource</code> identifying the audio
566  * elementary stream.
567  *
568  * @return Current audio samples per second.
569  */
570  int32_t (*GetSamplesPerSecond)(PP_Resource stream);
571  /**
572  * Sets how many audio samples were recorded per second (sample rate).
573  *
574  * @param[in] stream A <code>PP_Resource</code> identifying the audio
575  * elementary stream.
576  * @param[in] samples_per_second Value representing audio samples per second.
577  */
578  void (*SetSamplesPerSecond)(PP_Resource stream, int32_t samples_per_second);
579  /**
580  * Sets audio codec specific extra data. Those data are needed by audio codec
581  * to initialize properly audio decoding.
582  *
583  * @param[in] stream A <code>PP_Resource</code> identifying the audio
584  * elementary stream.
585  * @param[in] extra_data_size Size in bytes of |extra_data| buffer.
586  * @param[in] extra_data A pointer to the buffer containing audio codec
587  * specific extra data.
588  */
590  uint32_t extra_data_size,
591  const void* extra_data);
592 };
593 
596 
597 /**
598  * Interface representing an video elementary stream and containing methods
599  * to set video codec specific configuration.
600  *
601  * All pending configuration changes/initialization must be confirmed
602  * by call to <code>PPB_ElementaryStream_Samsung.InitializeDone</code>.
603  *
604  * All getters return last set configuration, which might be not confirmed yet.
605  */
607  /**
608  * Determines if the given resource is an video elementary stream.
609  *
610  * @param[in] resource A <code>PP_Resource</code> identifying a resource.
611  *
612  * @return <code>PP_TRUE</code> if the resource is a
613  * <code>PPB_VideoElementaryStream_Samsung</code>, <code>PP_FALSE</code>
614  * if the resource is invalid or some other type.
615  */
617  /**
618  * Retrieves current video codec type.
619  *
620  * @param[in] stream A <code>PP_Resource</code> identifying the video
621  * elementary stream.
622  *
623  * @return Current video codec type.
624  */
626  /**
627  * Sets new video codec type.
628  *
629  * @param[in] stream A <code>PP_Resource</code> identifying the video
630  * elementary stream.
631  * @param[in] audio_codec New video codec type.
632  */
634  PP_VideoCodec_Type_Samsung video_codec);
635  /**
636  * Retrieves current video codec profile.
637  *
638  * @param[in] stream A <code>PP_Resource</code> identifying the video
639  * elementary stream.
640  *
641  * @return Current audio codec profile.
642  */
644  /**
645  * Sets new video codec profile.
646  *
647  * @param[in] stream A <code>PP_Resource</code> identifying the video
648  * elementary stream.
649  * @param[in] profile New video codec profile.
650  */
653  /**
654  * Retrieves current video frame format.
655  *
656  * @param[in] stream A <code>PP_Resource</code> identifying the video
657  * elementary stream.
658  *
659  * @return Current video frame format.
660  */
662  /**
663  * Sets new video frame format.
664  *
665  * @param[in] stream A <code>PP_Resource</code> identifying the video
666  * elementary stream.
667  * @param[in] frame_format New video frame format.
668  */
670  PP_VideoFrame_Format_Samsung frame_format);
671  /**
672  * Retrieves current video frame size in pixels.
673  *
674  * @param[in] stream A <code>PP_Resource</code> identifying the video
675  * elementary stream.
676  * @param[out] size Current video frame size in pixels.
677  */
678  void (*GetVideoFrameSize)(PP_Resource stream, struct PP_Size* size);
679  /**
680  * Sets new video frame size in pixels.
681  *
682  * @param[in] stream A <code>PP_Resource</code> identifying the video
683  * elementary stream.
684  * @param[in] size New video frame size in pixels.
685  */
686  void (*SetVideoFrameSize)(PP_Resource stream, const struct PP_Size* size);
687  /**
688  * Retrieves current video frame rate as rational number represented by
689  * fraction |numerator| / |denominator|.
690  *
691  * Both |numerator| and |denominator| must be non-null, otherwise no
692  * information is retrieved.
693  *
694  * @param[in] stream A <code>PP_Resource</code> identifying the video
695  * elementary stream.
696  * @param[out] numerator A dividend of the quotient.
697  * @param[out] denominator A divisor of the quotient.
698  */
699  void (*GetFrameRate)(PP_Resource stream,
700  uint32_t* numerator,
701  uint32_t* denominator);
702  /**
703  * Sets new video frame rate as rational number represented by
704  * fraction |numerator| / |denominator|.
705  *
706  * Both |numerator| and |denominator| must be non-null, otherwise no
707  * information is set. Additionally |denominator| must be positive (!= 0).
708  *
709  * @param[in] stream A <code>PP_Resource</code> identifying the video
710  * elementary stream.
711  * @param[in] numerator A dividend of the quotient.
712  * @param[in] denominator A divisor of the quotient.
713  */
714  void (*SetFrameRate)(PP_Resource stream,
715  uint32_t numerator,
716  uint32_t denominator);
717  /**
718  * Sets video codec specific extra data. Those data are needed by video codec
719  * to initialize properly video decoding.
720  *
721  * @param[in] stream A <code>PP_Resource</code> identifying the video
722  * elementary stream.
723  * @param[in] extra_data_size Size in bytes of |extra_data| buffer.
724  * @param[in] extra_data A pointer to the buffer containing video codec
725  * specific extra data.
726  */
728  uint32_t extra_data_size,
729  const void* extra_data);
730 };
731 
734 /**
735  * @}
736  */
737 
738 #endif /* PPAPI_C_SAMSUNG_PPB_MEDIA_DATA_SOURCE_SAMSUNG_H_ */
739 
void(* GetVideoFrameSize)(PP_Resource stream, struct PP_Size *size)
PP_VideoFrame_Format_Samsung(* GetVideoFrameFormat)(PP_Resource stream)
int32_t(* SetEndOfStream)(PP_Resource data_source, struct PP_CompletionCallback callback)
void(* SetSamplesPerSecond)(PP_Resource stream, int32_t samples_per_second)
PP_Bool(* IsESDataSource)(PP_Resource resource)
PP_Bool(* IsAudioElementaryStream)(PP_Resource resource)
PP_ChannelLayout_Samsung
void(* SetChannelLayout)(PP_Resource stream, PP_ChannelLayout_Samsung channel_layout)
PP_Bool(* IsURLDataSource)(PP_Resource resource)
void(* SetCodecExtraData)(PP_Resource stream, uint32_t extra_data_size, const void *extra_data)
void(* SetVideoCodecProfile)(PP_Resource stream, PP_VideoCodec_Profile_Samsung profile)
int32_t(* SetDuration)(PP_Resource data_source, PP_TimeDelta duration, struct PP_CompletionCallback callback)
PP_Bool(* IsMediaDataSource)(PP_Resource resource)
void(* SetCodecExtraData)(PP_Resource stream, uint32_t extra_data_size, const void *extra_data)
PP_ChannelLayout_Samsung(* GetChannelLayout)(PP_Resource stream)
PP_AudioCodec_Profile_Samsung
int32_t PP_Resource
Definition: pp_resource.h:40
PP_Resource(* Create)(PP_Instance instance, const char *url)
PP_VideoCodec_Profile_Samsung
void(* SetBitsPerChannel)(PP_Resource stream, int32_t bits_per_channel)
PP_AudioCodec_Type_Samsung
void(* SetSampleFormat)(PP_Resource stream, PP_SampleFormat_Samsung sample_format)
PP_Resource(* Create)(PP_Instance instance)
int32_t(* AppendPacket)(PP_Resource stream, const struct PP_ESPacket *packet, struct PP_CompletionCallback callback)
int32_t(* AppendEncryptedPacket)(PP_Resource stream, const struct PP_ESPacket *packet, const struct PP_ESPacketEncryptionInfo *encryption_info, struct PP_CompletionCallback callback)
void(* SetAudioCodecType)(PP_Resource stream, PP_AudioCodec_Type_Samsung audio_codec)
int32_t(* SetStreamingProperty)(PP_Resource resource, PP_StreamingProperty type, struct PP_Var value, struct PP_CompletionCallback callback)
union PP_VarValue value
Definition: pp_var.h:180
PP_SampleFormat_Samsung
int32_t(* AddStream)(PP_Resource data_source, PP_ElementaryStream_Type_Samsung stream_type, const struct PPP_ElementaryStreamListener_Samsung_1_0 *listener, void *user_data, PP_Resource *stream, struct PP_CompletionCallback callback)
int32_t(* GetSamplesPerSecond)(PP_Resource stream)
Definition: pp_var.h:166
PP_SampleFormat_Samsung(* GetSampleFormat)(PP_Resource stream)
int32_t PP_Instance
Definition: pp_instance.h:34
void(* SetVideoFrameFormat)(PP_Resource stream, PP_VideoFrame_Format_Samsung frame_format)
void(* SetVideoFrameSize)(PP_Resource stream, const struct PP_Size *size)
int32_t(* Flush)(PP_Resource stream, struct PP_CompletionCallback callback)
PP_VideoFrame_Format_Samsung
void(* GetFrameRate)(PP_Resource stream, uint32_t *numerator, uint32_t *denominator)
PP_AudioCodec_Profile_Samsung(* GetAudioCodecProfile)(PP_Resource stream)
PP_Bool
Definition: pp_bool.h:30
int32_t(* GetStreamingProperty)(PP_Resource resource, PP_StreamingProperty type, struct PP_Var *value, struct PP_CompletionCallback callback)
int32_t(* InitializeDone)(PP_Resource stream, struct PP_CompletionCallback callback)
double PP_TimeDelta
Definition: pp_time.h:49
PP_VideoCodec_Type_Samsung
PP_ElementaryStream_Type_Samsung(* GetStreamType)(PP_Resource resource)
void(* SetAudioCodecProfile)(PP_Resource stream, PP_AudioCodec_Profile_Samsung profile)
PP_Bool(* IsVideoElementaryStream)(PP_Resource resource)
void(* SetVideoCodecType)(PP_Resource stream, PP_VideoCodec_Type_Samsung video_codec)
PP_VideoCodec_Type_Samsung(* GetVideoCodecType)(PP_Resource stream)
PP_ElementaryStream_Type_Samsung
int32_t(* SetDRMInitData)(PP_Resource stream, const char *type, uint32_t init_data_size, const void *init_data, struct PP_CompletionCallback callback)
PP_Bool(* IsElementaryStream)(PP_Resource resource)
PP_VideoCodec_Profile_Samsung(* GetVideoCodecProfile)(PP_Resource stream)
void(* SetFrameRate)(PP_Resource stream, uint32_t numerator, uint32_t denominator)
PP_AudioCodec_Type_Samsung(* GetAudioCodecType)(PP_Resource stream)