source: svn/newcon3bcm2_21bu/nexus/modules/file/include/nexus_file_fifo_chunk.h

Last change on this file was 76, checked in by megakiss, 10 years ago

1W 대기전력을 만족시키기 위하여 POWEROFF시 튜너를 Standby 상태로 함

  • Property svn:executable set to *
File size: 6.8 KB
Line 
1/***************************************************************************
2 *     (c)2005-2011 Broadcom Corporation
3 *
4 *  This program is the proprietary software of Broadcom Corporation and/or its licensors,
5 *  and may only be used, duplicated, modified or distributed pursuant to the terms and
6 *  conditions of a separate, written license agreement executed between you and Broadcom
7 *  (an "Authorized License").  Except as set forth in an Authorized License, Broadcom grants
8 *  no license (express or implied), right to use, or waiver of any kind with respect to the
9 *  Software, and Broadcom expressly reserves all rights in and to the Software and all
10 *  intellectual property rights therein.  IF YOU HAVE NO AUTHORIZED LICENSE, THEN YOU
11 *  HAVE NO RIGHT TO USE THIS SOFTWARE IN ANY WAY, AND SHOULD IMMEDIATELY
12 *  NOTIFY BROADCOM AND DISCONTINUE ALL USE OF THE SOFTWARE.
13 *
14 *  Except as expressly set forth in the Authorized License,
15 *
16 *  1.     This program, including its structure, sequence and organization, constitutes the valuable trade
17 *  secrets of Broadcom, and you shall use all reasonable efforts to protect the confidentiality thereof,
18 *  and to use this information only in connection with your use of Broadcom integrated circuit products.
19 *
20 *  2.     TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS"
21 *  AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES, REPRESENTATIONS OR
22 *  WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO
23 *  THE SOFTWARE.  BROADCOM SPECIFICALLY DISCLAIMS ANY AND ALL IMPLIED WARRANTIES
24 *  OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE,
25 *  LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION
26 *  OR CORRESPONDENCE TO DESCRIPTION. YOU ASSUME THE ENTIRE RISK ARISING OUT OF
27 *  USE OR PERFORMANCE OF THE SOFTWARE.
28 *
29 *  3.     TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL BROADCOM OR ITS
30 *  LICENSORS BE LIABLE FOR (i) CONSEQUENTIAL, INCIDENTAL, SPECIAL, INDIRECT, OR
31 *  EXEMPLARY DAMAGES WHATSOEVER ARISING OUT OF OR IN ANY WAY RELATING TO YOUR
32 *  USE OF OR INABILITY TO USE THE SOFTWARE EVEN IF BROADCOM HAS BEEN ADVISED OF
33 *  THE POSSIBILITY OF SUCH DAMAGES; OR (ii) ANY AMOUNT IN EXCESS OF THE AMOUNT
34 *  ACTUALLY PAID FOR THE SOFTWARE ITSELF OR U.S. $1, WHICHEVER IS GREATER. THESE
35 *  LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF ESSENTIAL PURPOSE OF
36 *  ANY LIMITED REMEDY.
37 *
38 * $brcm_Workfile: nexus_file_fifo_chunk.h $
39 * $brcm_Revision: 2 $
40 * $brcm_Date: 8/15/11 3:48p $
41 *
42 * Module Description:
43 *
44 *
45 * Revision History:
46 *
47 *
48 *
49 *
50 ***************************************************************************/
51#ifndef NEXUS_FILE_FIFO_CHUNK_H__
52#define NEXUS_FILE_FIFO_CHUNK_H__
53
54#include "nexus_file.h"
55
56#ifdef __cplusplus
57extern "C" {
58#endif
59
60/*
61Summary:
62Type of record file suitable for timeshifting
63*/
64typedef struct NEXUS_ChunkedFifoRecord *NEXUS_ChunkedFifoRecordHandle;
65
66/*
67Summary:
68Configuration parameters for the timeshifting buffer
69
70Description:
71Those numbers are used to limit size of the timishifting buffer to be occupied on the disk.
72Usually software stack would try do not exceed soft limit of the timeshifting buffer, however
73in certain cases, for example, if bitrates of the recorded stream suddenly increases, it could
74go up to hardlimit. Once hardlimit is reached it would result in the overflow error.
75*/
76typedef struct NEXUS_ChunkedFifoRecordLimit {
77    off_t soft; /* soft limit of the timeshifting buffer, in bytes */
78    off_t hard; /* hard limit of the timeshifting buffer, in bytes */
79    off_t chunkSize;    /* Maximum size of the single chunk, 0 - unlimited size */
80} NEXUS_ChunkedFifoRecordLimit;
81
82/*
83Summary:
84Configuration parameters for the timeshifting file
85*/
86typedef struct NEXUS_ChunkedFifoRecordSettings {
87    unsigned interval; /* Size of the timeshifting buffer, in seconds */
88    unsigned snapshotInterval; /* interval between metadata writes, in seconds. 0 means metadata written only when file is closed */
89    NEXUS_ChunkedFifoRecordLimit data; /* Limits for the timeshifting data file */
90    NEXUS_ChunkedFifoRecordLimit index; /* Limits for the timeshifting index file */
91    char chunkTemplate[128]; /* template for the individual chunk file names, e.g. "chunk_%04.mpg" */
92} NEXUS_ChunkedFifoRecordSettings;
93
94/*
95Summary:
96Get default settings
97*/
98void NEXUS_ChunkedFifoRecord_GetDefaultSettings(
99    NEXUS_ChunkedFifoRecordSettings *pSettings /* [out] */
100    );
101
102/*
103Summary:
104This function opens new timeshifting buffer
105
106Description:
107The NEXUS_ChunkedFifoRecordHandle can be used for only one record at a time.
108The files will be created if they don't already exist, and truncated if they do.
109The index file is mandatory for the timeshifting.
110*/
111NEXUS_ChunkedFifoRecordHandle NEXUS_ChunkedFifoRecord_Create(
112    const char *mpegFileName, /* mpeg file name to create */
113    const char *indexFileName /* index file name to create */
114    );
115
116/*
117Summary:
118This function returns a handle to be passed into the NEXUS_Record_Start().
119*/
120NEXUS_FileRecordHandle NEXUS_ChunkedFifoRecord_GetFile(
121    NEXUS_ChunkedFifoRecordHandle fifo /* Handle returned by NEXUS_ChunkedFifoRecord_Create */
122    );
123
124/**
125Summary:
126This value is returned by NEXUS_ChunkedFifoRecord_GetPosition to indicate if timestamp or index position is invalid
127**/
128#define NEXUS_FILE_INVALID_POSITION ((unsigned long)-1)
129
130/*
131Summary:
132This function returns current position of the recorded file
133*/
134NEXUS_Error NEXUS_ChunkedFifoRecord_GetPosition(
135    NEXUS_ChunkedFifoRecordHandle fifo, /* Handle returned by NEXUS_ChunkedFifoRecord_Create */
136    NEXUS_FilePosition *pFirst,  /* [out] first position in the file */
137    NEXUS_FilePosition *pLast    /* [out] last position in the file */
138    );
139
140/*
141Summary:
142Open a playback file to pass to NEXUS_Playback_Start().
143
144Description:
145This function shall be used only for files created by NEXUS_ChunkedFifoRecord_Create.
146The NEXUS_FilePlayHandle can be used for only one playback at a time.
147*/
148NEXUS_FilePlayHandle NEXUS_ChunkedFifoPlay_Open(
149    const char *mpegFileName,
150    const char *indexFileName,
151    NEXUS_ChunkedFifoRecordHandle writer /* Handle returned by NEXUS_ChunkedFifoRecord_Create */
152    );
153
154/*
155Summary:
156This function returns current configuration of the timeshifting fifo
157*/
158void NEXUS_ChunkedFifoRecord_GetSettings(
159    NEXUS_ChunkedFifoRecordHandle fifo, /* Handle returned by NEXUS_ChunkedFifoRecord_Create */
160    NEXUS_ChunkedFifoRecordSettings *pSettings /* [out] current settings of timeshifting buffer */
161    );
162
163/*
164Summary:
165This function sets the new configuration of the timeshifting fifo
166*/
167NEXUS_Error NEXUS_ChunkedFifoRecord_SetSettings(
168    NEXUS_ChunkedFifoRecordHandle fifo, /* Handle returned by NEXUS_ChunkedFifoRecord_Create */
169    const NEXUS_ChunkedFifoRecordSettings *pSettings /* new settings of timeshifting buffer */
170    );
171
172#ifdef __cplusplus
173}
174#endif
175
176#endif /* NEXUS_FILE_FIFO_CHUNK_H__ */
Note: See TracBrowser for help on using the repository browser.