• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2014 Amlogic Corporation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef AMVDEC_AMVIDEO_HEADER_SS
18 #define  AMVDEC_AMVIDEO_HEADER_SS
19 #include <stdlib.h>
20 //#include <linux/videodev2.h>
21 #include "videodev2.h"
22 #define FLAGS_OVERLAY_MODE (1)
23 #define FLAGS_V4L_MODE 	 (2)
24 
25 struct amvideo_dev;
26 typedef struct vframebuf{
27 	char * vbuf;
28 	int fd;
29 	int index;
30 	int offset;
31 	int length;
32 	int64_t pts;
33 	int duration;
34     int width;
35     int height;
36 }vframebuf_t;
37 
38 struct amvideo_dev_ops{
39 	int (*setparameters)(struct amvideo_dev *dev,int cmd,void*para);
40 	int (*init)(struct amvideo_dev *dev,int flags,int width,int height,int fmt,int buffernum);
41 	int (*release)(struct amvideo_dev *dev);
42 	int (*dequeuebuf)(struct amvideo_dev *dev,vframebuf_t*vf);
43 	int (*queuebuf)(struct amvideo_dev *dev,vframebuf_t*vf);
44 	int (*start)(struct amvideo_dev *dev);
45 	int (*stop)(struct amvideo_dev *dev);
46 };
47 
48 typedef struct amvideo_dev{
49 	char devname[8];
50 	int mode;
51     int display_mode;
52 	struct amvideo_dev_ops ops;
53 	void *devpriv;
54 }amvideo_dev_t;
55 
56 
57 typedef struct amvideo{
58 	amvideo_dev_t *dev;
59 }amvideo_t;
60 
61 
62 amvideo_dev_t *new_amvideo(int flags);
63 int amvideo_setparameters(amvideo_dev_t *dev, int cmd, void * parameters);
64 int amvideo_init(amvideo_dev_t *dev,int flags,int width,int height,int fmt,int buffernum);
65 int amvideo_start(amvideo_dev_t *dev);
66 int amvideo_stop(amvideo_dev_t *dev);
67 int amvideo_release(amvideo_dev_t *dev);
68 int amlv4l_dequeuebuf(amvideo_dev_t *dev, vframebuf_t*vf);
69 int amlv4l_queuebuf(amvideo_dev_t *dev, vframebuf_t*vf);
70 #endif
71