liboggplay  0.3.0
oggplay.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2003 Commonwealth Scientific and Industrial Research
3  Organisation (CSIRO) Australia
4 
5  Redistribution and use in source and binary forms, with or without
6  modification, are permitted provided that the following conditions
7  are met:
8 
9  - Redistributions of source code must retain the above copyright
10  notice, this list of conditions and the following disclaimer.
11 
12  - Redistributions in binary form must reproduce the above copyright
13  notice, this list of conditions and the following disclaimer in the
14  documentation and/or other materials provided with the distribution.
15 
16  - Neither the name of CSIRO Australia nor the names of its
17  contributors may be used to endorse or promote products derived from
18  this software without specific prior written permission.
19 
20  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
23  PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
24  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32 
43 #ifndef OGGPLAY_HEADER
44 #define OGGPLAY_HEADER
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
50 #include <oggplay/oggplay_enums.h>
51 #include <oggplay/oggplay_reader.h>
52 
56 typedef struct OggPlay_ OggPlay;
57 
62 typedef struct OggPlayCallbackInfo_ OggPlayCallbackInfo;
63 
76 typedef int (OggPlayDataCallback) (OggPlay *player, int num_records,
77  OggPlayCallbackInfo **records, void *user);
78 
79 #include <oggplay/oggplay_query.h>
81 #include <oggplay/oggplay_tools.h>
82 #include <oggplay/oggplay_seek.h>
83 
95 OggPlay *
97 
105 OggPlay *
107 
108 
128 oggplay_initialise(OggPlay *me, int block);
129 
143  void *user);
144 
145 
147 oggplay_set_callback_num_frames(OggPlay *me, int stream, int frames);
148 
150 oggplay_set_callback_period(OggPlay *me, int stream, int milliseconds);
151 
153 oggplay_set_offset(OggPlay *me, int track, ogg_int64_t offset);
154 
169 oggplay_get_video_y_size(OggPlay *me, int track, int *y_width, int *y_height);
170 
185 oggplay_get_video_uv_size(OggPlay *me, int track, int *uv_width, int *uv_height);
186 
200 oggplay_get_audio_channels(OggPlay *me, int track, int *channels);
201 
215 oggplay_get_audio_samplerate(OggPlay *me, int track, int *samplerate);
216 
231 oggplay_get_video_fps(OggPlay *me, int track, int* fps_denom, int* fps_num);
232 
234 oggplay_get_video_aspect_ratio(OggPlay *me, int track, int* aspect_denom, int* aspect_num);
235 
237 oggplay_convert_video_to_rgb(OggPlay *me, int track, int convert, int swap_rgb);
238 
240 oggplay_get_kate_category(OggPlay *me, int track, const char** category);
241 
243 oggplay_get_kate_language(OggPlay *me, int track, const char** language);
244 
246 oggplay_set_kate_tiger_rendering(OggPlay *me, int track, int use_tiger, int swap_rgb, int default_width, int default_height);
247 
249 oggplay_overlay_kate_track_on_video(OggPlay *me, int kate_track, int video_track);
250 
252 oggplay_start_decoding(OggPlay *me);
253 
271 
295 oggplay_use_buffer(OggPlay *player, int size);
296 
306 
321 oggplay_buffer_release(OggPlay *player, OggPlayCallbackInfo **track_info);
322 
323 void
324 oggplay_prepare_for_close(OggPlay *me);
325 
334 oggplay_close(OggPlay *player);
335 
336 int
337 oggplay_get_available(OggPlay *player);
338 
346 ogg_int64_t
347 oggplay_get_duration(OggPlay * player);
348 
349 int
350 oggplay_media_finished_retrieving(OggPlay * player);
351 
352 #ifdef __cplusplus
353 }
354 #endif
355 
356 #endif /* OGGPLAY_HEADER */
OggPlayErrorCode oggplay_get_audio_samplerate(OggPlay *me, int track, int *samplerate)
Get the sample rate of the of the audio track.
OggPlayErrorCode oggplay_use_buffer(OggPlay *player, int size)
Use the built-in OggPlayBuffer for buffering the decoded frames.
OggPlayErrorCode oggplay_buffer_release(OggPlay *player, OggPlayCallbackInfo **track_info)
Release the given buffer item.
OggPlayErrorCode oggplay_initialise(OggPlay *me, int block)
Initialise the OggPlay handle.
struct OggPlayCallbackInfo_ OggPlayCallbackInfo
A structure for storing the decoded frames for the various streams in the Ogg container.
Definition: oggplay.h:62
oggplay_query.h
struct OggPlay_ OggPlay
This is returned by oggplay_open_with_reader() or oggplay_new_with_reader().
Definition: oggplay.h:56
oggplay_seek.h
OggPlayCallbackInfo ** oggplay_buffer_retrieve_next(OggPlay *player)
Retrive the next element in the buffer.
OggPlay * oggplay_open_with_reader(OggPlayReader *reader)
Create an OggPlay handle associated with the given reader.
General constants used by liboggplay.
OggPlayErrorCode oggplay_get_video_uv_size(OggPlay *me, int track, int *uv_width, int *uv_height)
Get the given video track's UV-plane's width and height.
OggPlayErrorCode oggplay_step_decoding(OggPlay *me)
Decode the streams in the Ogg container until we find data that hasn't been presented, yet.
oggplay_callback_info.h
int( OggPlayDataCallback)(OggPlay *player, int num_records, OggPlayCallbackInfo **records, void *user)
This is the signature of a callback which you must provide for OggPlay to call whenever there's any u...
Definition: oggplay.h:76
ogg_int64_t oggplay_get_duration(OggPlay *player)
Get the duration of the Ogg content.
Definition: oggplay_reader.h:51
OggPlayErrorCode oggplay_set_data_callback(OggPlay *me, OggPlayDataCallback callback, void *user)
Sets a user defined OggPlayDataCallback function for the OggPlay handle.
OggPlayErrorCode oggplay_close(OggPlay *player)
Destroys the OggPlay handle along with the associated OggPlayReader and clears out the buffer and shu...
OggPlayErrorCode
Definitions of error return values.
Definition: oggplay_enums.h:48
oggplay_tools.h
OggPlay * oggplay_new_with_reader(OggPlayReader *reader)
Create a new OggPlay handle associated with the given reader.
oggplay_reader.h
OggPlayErrorCode oggplay_get_audio_channels(OggPlay *me, int track, int *channels)
Get the number of channels of the audio track.
OggPlayErrorCode oggplay_get_video_fps(OggPlay *me, int track, int *fps_denom, int *fps_num)
Get the frame-per-second value the of a given video track.
OggPlayErrorCode oggplay_get_video_y_size(OggPlay *me, int track, int *y_width, int *y_height)
Get the given video track's Y-plane's width and height.