⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dvdnav.h

📁 linux下的MPEG1
💻 H
📖 第 1 页 / 共 2 页
字号:
/*  * Copyright (C) 2001 Rich Wareham <richwareham@users.sourceforge.net> *  * This file is part of libdvdnav, a DVD navigation library. *  * libdvdnav is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. *  * libdvdnav is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. *  * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA * * $Id: dvdnav.h,v 1.15 2005/10/14 21:02:16 miguelfreitas Exp $ * *//* * This is the main header file applications should include if they want * to access dvdnav functionality. */#ifndef DVDNAV_H_INCLUDED#define DVDNAV_H_INCLUDED#ifdef __cplusplusextern "C" {#endif#ifdef DVDNAV_COMPILE#  include "dvdnav_events.h"#  include "dvd_types.h"#  include "dvd_reader.h"#  include "ifo_types.h" /* For vm_cmd_t */#else#  include <dvdnav/dvdnav_events.h>#  include <dvdnav/dvd_types.h>#  include <dvdnav/dvd_reader.h>#  include <dvdnav/ifo_types.h> /* For vm_cmd_t */#endif/********************************************************************* * dvdnav data types                                                 * *********************************************************************//* * Opaque data-type can be viewed as a 'DVD handle'. You should get * a pointer to a dvdnav_t from the dvdnav_open() function. * Never call free() on the pointer, you have to give it back with * dvdnav_close(). */typedef struct dvdnav_s dvdnav_t;/* Status as reported by most of libdvdnav's functions */typedef int32_t dvdnav_status_t;/* * Unless otherwise stated, all functions return DVDNAV_STATUS_OK if * they succeeded, otherwise DVDNAV_STATUS_ERR is returned and the error may * be obtained by calling dvdnav_err_to_string(). */#define DVDNAV_STATUS_ERR 0#define DVDNAV_STATUS_OK  1/********************************************************************* * initialisation & housekeeping functions                           * *********************************************************************//* * These functions allow you to open a DVD device and associate it * with a dvdnav_t. *//* * Attempts to open the DVD drive at the specified path and pre-cache * the CSS-keys. libdvdread is used to access the DVD, so any source * supported by libdvdread can be given with "path". Currently, * libdvdread can access: DVD drives, DVD image files, DVD file-by-file * copies. * * The resulting dvdnav_t handle will be written to *dest. */dvdnav_status_t dvdnav_open(dvdnav_t **dest, const char *path);/* * Closes a dvdnav_t previously opened with dvdnav_open(), freeing any  * memory associated with it. */dvdnav_status_t dvdnav_close(dvdnav_t *self);/* * Resets the DVD virtual machine and cache buffers. */dvdnav_status_t dvdnav_reset(dvdnav_t *self);/* * Fills a pointer with a value pointing to a string describing * the path associated with an open dvdnav_t. It assigns *path to NULL * on error. */dvdnav_status_t dvdnav_path(dvdnav_t *self, const char **path);/* * Returns a human-readable string describing the last error. */const char* dvdnav_err_to_string(dvdnav_t *self);/* converts a dvd_time_t to PTS ticks */int64_t dvdnav_convert_time(dvd_time_t *time);/********************************************************************* * changing and reading DVD player characteristics                   * *********************************************************************//* * These functions allow you to manipulate the various global characteristics * of the DVD playback engine. *//* * Sets the region mask (bit 0 set implies region 1, bit 1 set implies * region 2, etc) of the virtual machine. Generally you will only need to set * this if you are playing RCE discs which query the virtual machine as to its * region setting.  * * This has _nothing_ to do with the region setting of the DVD drive. */dvdnav_status_t dvdnav_set_region_mask(dvdnav_t *self, int32_t region_mask);/* * Returns the region mask (bit 0 set implies region 1, bit 1 set implies * region 2, etc) of the virtual machine. * * This has _nothing_ to do with the region setting of the DVD drive. */dvdnav_status_t dvdnav_get_region_mask(dvdnav_t *self, int32_t *region_mask);/* * Specify whether read-ahead caching should be used. You may not want this if your * decoding engine does its own buffering. * * The default read-ahead cache does not use an additional thread for the reading * (see read_cache.c for a threaded cache, but note that this code is currently * unmaintained). It prebuffers on VOBU level by reading ahead several buffers * on every read request. The speed of this prebuffering has been optimized to * also work on slow DVD drives. * * If in addition you want to prevent memcpy's to improve performance, have a look * at dvdnav_get_next_cache_block(). */dvdnav_status_t dvdnav_set_readahead_flag(dvdnav_t *self, int32_t read_ahead_flag);/* * Query whether read-ahead caching/buffering will be used. */dvdnav_status_t dvdnav_get_readahead_flag(dvdnav_t *self, int32_t *read_ahead_flag);/* * Specify whether the positioning works PGC or PG based. * Programs (PGs) on DVDs are similar to Chapters and a program chain (PGC) * usually covers a whole feature. This affects the behaviour of the * functions dvdnav_get_position() and dvdnav_sector_search(). See there. * Default is PG based positioning. */dvdnav_status_t dvdnav_set_PGC_positioning_flag(dvdnav_t *self, int32_t pgc_based_flag);/* * Query whether positioning is PG or PGC based. */dvdnav_status_t dvdnav_get_PGC_positioning_flag(dvdnav_t *self, int32_t *pgc_based_flag);/********************************************************************* * reading data                                                      * *********************************************************************//* * These functions are used to poll the playback enginge and actually get data  * off the DVD. *//* * Attempts to get the next block off the DVD and copies it into the buffer 'buf'.  * If there is any special actions that may need to be performed, the value * pointed to by 'event' gets set accordingly. * * If 'event' is DVDNAV_BLOCK_OK then 'buf' is filled with the next block * (note that means it has to be at /least/ 2048 bytes big). 'len' is * then set to 2048. * * Otherwise, buf is filled with an appropriate event structure and * len is set to the length of that structure. * * See the dvdnav_events.h header for information on the various events. */dvdnav_status_t dvdnav_get_next_block(dvdnav_t *self, uint8_t *buf,				      int32_t *event, int32_t *len);/* * This basically does the same as dvdnav_get_next_block. The only difference is * that it avoids a memcopy, when the requested block was found in the cache. * I such a case (cache hit) this function will return a different pointer than * the one handed in, pointing directly into the relevant block in the cache. * Those pointers must _never_ be freed but instead returned to the library via * dvdnav_free_cache_block(). */dvdnav_status_t dvdnav_get_next_cache_block(dvdnav_t *self, uint8_t **buf,					    int32_t *event, int32_t *len);/* * All buffers which came from the internal cache (when dvdnav_get_next_cache_block() * returned a buffer different from the one handed in) have to be freed with this * function. Although handing in other buffers not from the cache doesn't cause any harm. */dvdnav_status_t dvdnav_free_cache_block(dvdnav_t *self, unsigned char *buf);/* * If we are currently in a still-frame this function skips it. * * See also the DVDNAV_STILL_FRAME event. */dvdnav_status_t dvdnav_still_skip(dvdnav_t *self);/* * If we are currently in WAIT state, that is: the application is required to * wait for its fifos to become empty, calling this signals libdvdnav that this * is achieved and that it can continue. * * See also the DVDNAV_WAIT event. */dvdnav_status_t dvdnav_wait_skip(dvdnav_t *self);/* * Returns the still time from the currently playing cell. * The still time is given in seconds with 0xff meaning an indefinite still. * * This function can be used to detect still frames before they are reached. * Some players might need this to prepare for a frame to be shown for a * longer time than usual. */uint32_t dvdnav_get_next_still_flag(dvdnav_t *self);/* * Stops playback. The next event obtained with one of the get_next_block * functions will be a DVDNAV_STOP event. * * It is not required to call this before dvdnav_close(). */dvdnav_status_t dvdnav_stop(dvdnav_t *self);/********************************************************************* * title/part navigation                                             * *********************************************************************//* * Returns the number of titles on the disk. */dvdnav_status_t dvdnav_get_number_of_titles(dvdnav_t *self, int32_t *titles);/* * Returns the number of parts within the given title. */dvdnav_status_t dvdnav_get_number_of_parts(dvdnav_t *self, int32_t title, int32_t *parts);/* * Plays the specified title of the DVD from its beginning (that is: part 1). */dvdnav_status_t dvdnav_title_play(dvdnav_t *self, int32_t title);/* * Plays the specified title, starting from the specified part. */dvdnav_status_t dvdnav_part_play(dvdnav_t *self, int32_t title, int32_t part);/* * Play the specified amount of parts of the specified title of * the DVD then STOP. * * Currently unimplemented! */dvdnav_status_t dvdnav_part_play_auto_stop(dvdnav_t *self, int32_t title,					   int32_t part, int32_t parts_to_play);/* * Play the specified title starting from the specified time. * * Currently unimplemented! */dvdnav_status_t dvdnav_time_play(dvdnav_t *self, int32_t title,				 uint64_t time);/* * Stop playing the current position and jump to the specified menu. * * See also DVDMenuID_t from libdvdread */dvdnav_status_t dvdnav_menu_call(dvdnav_t *self, DVDMenuID_t menu);/* * Return the title number and part currently being played. * A title of 0 indicates, we are in a menu. In this case, part * is set to the current menu's ID. */dvdnav_status_t dvdnav_current_title_info(dvdnav_t *self, int32_t *title,					  int32_t *part);/* * Return the current position (in blocks) within the current * title and the length (in blocks) of said title.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -