4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Seungbae Shin <seungbae.shin@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
22 #ifndef __MM_SOURCE_H__
23 #define __MM_SOURCE_H__
29 MM_SOURCE_MEMORY_NOTALLOC,
34 MM_SOURCE_NOT_DRM_CONTENTS = 0,
35 MM_SOURCE_CHECK_DRM_CONTENTS
39 int type; /**< source type (file or memory) */
40 void *ptr; /**< pointer to buffer */
41 unsigned int cur_size; /**< size of current memory */
42 unsigned int tot_size; /**< size of current memory */
43 int fd; /**< file descriptor for file */
44 unsigned int medOffset; /**Media Offset */
47 #define MMSourceIsUnUsed(psource) \
48 ((psource)->type == MM_SOUND_SOURCE_NONE)
50 #define MMSourceIsFile(psource) \
51 ((psource)->type == MM_SOUND_SOURCE_FILE)
53 #define MMSourceIsMemory(psource) \
54 ((psource)->type == MM_SOUND_SOURCE_MEMORY)
56 #define MMSourceGetPtr(psource) \
59 #define MMSourceGetCurSize(psource) \
62 #define MMSourceGetTotSize(psource) \
65 int mm_source_open_file(const char *filename, MMSourceType* source, int drmsupport);
66 int mm_source_open_full_memory(const void *ptr, int totsize, int alloc, MMSourceType *source);
67 int mm_source_open_memory(const void *ptr, int totsize, int size, MMSourceType *source);
68 int mm_source_append_memory(const void *ptr, int size, MMSourceType *source);
69 int mm_source_close(MMSourceType *source);
71 #endif /* __MM_SOURCE_H__ */