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