/*
 *******************************************************************************
 *  Copyright (c) 2010-2022 VATICS(KNERON) Inc. All rights reserved.
 *
 *  +-----------------------------------------------------------------+
 *  | THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED |
 *  | AND COPIED IN ACCORDANCE WITH THE TERMS AND CONDITIONS OF SUCH  |
 *  | A LICENSE AND WITH THE INCLUSION OF THE THIS COPY RIGHT NOTICE. |
 *  | THIS SOFTWARE OR ANY OTHER COPIES OF THIS SOFTWARE MAY NOT BE   |
 *  | PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON. THE   |
 *  | OWNERSHIP AND TITLE OF THIS SOFTWARE IS NOT TRANSFERRED.        |
 *  |                                                                 |
 *  | THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT   |
 *  | ANY PRIOR NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY |
 *  | VATICS(KNERON) INC.                                             |
 *  +-----------------------------------------------------------------+
 *
 *******************************************************************************
 */
#ifndef __MP4_READER_H__
#define __MP4_READER_H__

#ifdef __cplusplus
extern "C" {
#endif

#include <stddef.h>
#include <mp4_reader/mp4_parser.h>
//#include "mp4_parser.h"

typedef struct mp4_reader_handle_t
{
	int fd_; /**< The file descriptor of MP4 file. */
	mp4_headers_info_t *mp4_info_; /**< The pointer to point the MP4 information structure. */
} mp4_reader_handle_t;

void MP4Reader_Init(mp4_reader_handle_t *handle);
void MP4Reader_Release(mp4_reader_handle_t *handle);

int MP4Reader_LoadMP4File(mp4_reader_handle_t *, const char* filename);
int MP4Reader_GetSample(mp4_reader_handle_t *handle, char* buf, size_t buf_len, size_t *data_len, unsigned int track_id, unsigned int *keyframeinfo);

#ifdef __cplusplus
}
#endif

#endif

