~ubuntu-branches/ubuntu/trusty/ocaml-ogg/trusty

« back to all changes in this revision

Viewing changes to src/ogg.mli

  • Committer: Bazaar Package Importer
  • Author(s): Samuel Mimram
  • Date: 2009-02-22 13:53:45 UTC
  • mfrom: (2.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090222135345-veie6vwi4s512n2w
Tags: 0.3.0-1
* New Upstream Version.
* Switch packaging to git.
* Use dh-ocaml's variables for paths.
* Update compat to 7.

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
  (** 
60
60
    * Returns the unique serial number for the logical bitstream of this page. 
61
61
    * Each page contains the serial number for the logical bitstream that it belongs to.*)
62
 
  val serialno : t -> int
 
62
  val serialno : t -> nativeint
63
63
 
64
64
  (** 
65
65
    * Indicates whether this page is at the end of the logical bitstream. *)
104
104
    *
105
105
    * For example, in audio codecs this position is the pcm sample number and 
106
106
    * in video this is the frame number.*)
107
 
  val granulepos : t -> int
 
107
  val granulepos : t -> Int64.t
108
108
 
109
109
  (**
110
110
    * Returns the sequential page number. 
111
111
    * 
112
112
    * This is useful for ordering pages or determining when pages have been lost. *)
113
 
  val pageno : t -> int
 
113
  val pageno : t -> nativeint
114
114
 
115
115
  (**
116
116
    * Checksums an ogg_page. *)
132
132
 
133
133
  (**
134
134
    * Wrapper around [create] to open a file as the ogg stream. *)
135
 
  val create_from_file : string -> t
 
135
  val create_from_file : string -> (t*Unix.file_descr)
136
136
 
137
137
  (** 
138
138
    * Read a page from [Sync.t] 
163
163
  (**
164
164
    * Create a [stream].
165
165
    *)
166
 
  val create : ?serial:int -> unit -> stream
 
166
  val create : ?serial:nativeint -> unit -> stream
 
167
 
 
168
  (** 
 
169
    * Get a stream's serial number.
 
170
    *)
 
171
  val serialno : stream -> nativeint
 
172
 
 
173
  (** Returns true if the end of stream has been reached. *)
 
174
  val eos : stream -> bool
167
175
 
168
176
  (**
169
177
    * This function forms packets into pages. Internally,
210
218
  val get_packet : ?sync:(bool ref) -> stream -> packet
211
219
 
212
220
  (**
 
221
    * This function assembles a data packet for output
 
222
    * to the codec decoding engine without advancing the stream.
 
223
    *
 
224
    * Raises [Not_enough_data] if more data is needed and another page should be submitted.
 
225
    *
 
226
    * Raises [Out_of_sync]  if we are out of sync and there is a gap in the data *)
 
227
  val peek_packet : stream -> packet
 
228
 
 
229
  (**
 
230
    * This function submits a packet to the bitstream for page encapsulation. 
 
231
    * After this is called, more packets can be submitted, or pages can be written out.
 
232
    *
 
233
    * This function is provided to ease ogg strea multiplexing, where packet submission
 
234
    * order is important. It should not be used to encoder further data. *)
 
235
  val put_packet : stream -> packet -> unit
 
236
 
 
237
  (**
213
238
    * This function checks for remaining packets inside the stream and forces
214
239
    * remaining packets into a page, regardless of the size of the page.
215
240
    *
237
262
 
238
263
end
239
264
 
 
265
module Skeleton : 
 
266
sig
 
267
 
 
268
  (**
 
269
    * Create an initial ogg skeleton packet ('fishead'),
 
270
    * to complete with data packet from the various codecs
 
271
    * in the stream ('fishbone').
 
272
    * See: http://xiph.org/ogg/doc/skeleton.html. *)
 
273
  val fishead :
 
274
    ?presentation_numerator:Int64.t ->
 
275
    ?presentation_denominator:Int64.t ->
 
276
    ?basetime_numerator:Int64.t ->
 
277
    ?basetime_denominator:Int64.t -> ?utc:Int32.t -> unit -> Stream.packet
 
278
 
 
279
 (** Create an end-of-stream packet for
 
280
   * an ogg skeleton logical stream *)
 
281
 val eos : unit -> Stream.packet
 
282
 
 
283
end