1 /*
2 * transcode_specifics.h
3 *
4 * Copyright (C) Georg Martius - February 2013
5 * georg dot martius at web dot de
6 *
7 * This file is part of transcode, a video stream processing tool
8 *
9 * transcode is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2, or (at your option)
12 * any later version.
13 *
14 * transcode is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with GNU Make; see the file COPYING. If not, write to
21 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
22 *
23 */
24
25 #ifndef __TRANSCODE_SPECIFICS_H
26 #define __TRANSCODE_SPECIFICS_H
27
28 #include "vidstabdefines.h"
29 #include "frameinfo.h"
30 #include <transcode.h>
31
transcode2ourPF(int tc_img_codec)32 static VSPixelFormat transcode2ourPF(int tc_img_codec){
33 switch(tc_img_codec){
34 case CODEC_RGB:
35 return PF_RGB24;
36 case CODEC_YUV:
37 return PF_YUV420P;
38 case CODEC_YUV422:
39 return PF_YUV422P;
40 default:
41 tc_log_error(MOD_NAME, "cannot deal with img format %i!\n", tc_img_codec);
42 return PF_NONE;
43 }
44 }
45
setLogFunctions()46 void setLogFunctions(){
47 // we cannot map the memory functions because they are macros
48 // with FILE and LINE expansion in transcode
49
50 VS_ERROR_TYPE = TC_LOG_ERR;
51 VS_WARN_TYPE = TC_LOG_WARN;
52 VS_INFO_TYPE = TC_LOG_INFO;
53 VS_MSG_TYPE = TC_LOG_MSG;
54
55 // we need the case because tc_log has first argument TCLogLevel
56 // which is an enum and not an int
57 vs_log = (vs_log_t)tc_log;
58
59 VS_ERROR = TC_ERROR;
60 VS_OK = TC_OK;
61 }
62
63 #endif
64