common.h 2.84 KB
Newer Older
Nicolas Pomepuy's avatar
Nicolas Pomepuy committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
/*****************************************************************************
 * Copyright © 2015 VideoLAN, VideoLabs SAS
 *****************************************************************************
 *
 * Authors: Nicolas Rechatin [nicolas@videolabs.io]
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 *****************************************************************************/
/*
 * By committing to this project, you allow VideoLAN and VideoLabs to relicense
 * the code to a different OSI approved license, in case it is required for
 * compatibility with the Store
 *****************************************************************************/

#ifndef __vlc_common_H__
#define __vlc_common_H__

30 31 32
#ifndef _GNU_SOURCE
# define _GNU_SOURCE
#endif
Nicolas Pomepuy's avatar
Nicolas Pomepuy committed
33 34 35

#include <stdio.h>
#include <stdlib.h>
36 37

#include <tizen.h>
38
#include <app_common.h>
Nicolas Pomepuy's avatar
Nicolas Pomepuy committed
39 40 41 42 43
#include <dlog.h>

#ifdef  LOG_TAG
# undef  LOG_TAG
#endif
44
#define LOG_TAG "vlc"
Nicolas Pomepuy's avatar
Nicolas Pomepuy committed
45

Thomas Guillem's avatar
Thomas Guillem committed
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
#undef LOGD
#undef LOGI
#undef LOGW
#undef LOGE
#undef LOGF
#ifdef _DEBUG
#define LOGD(...)  dlog_print(DLOG_DEBUG, LOG_TAG, __VA_ARGS__)
#else
#define LOGD(...)
#endif
#define LOGI(...)  dlog_print(DLOG_INFO, LOG_TAG, __VA_ARGS__)
#define LOGW(...)  dlog_print(DLOG_WARN, LOG_TAG, __VA_ARGS__)
#define LOGE(...)  dlog_print(DLOG_ERROR, LOG_TAG, __VA_ARGS__)
#define LOGF(...)  dlog_print(DLOG_FATAL, LOG_TAG, __VA_ARGS__)


Nicolas Pomepuy's avatar
Nicolas Pomepuy committed
62 63 64 65
#if !defined(PACKAGE)
# define PACKAGE "org.videolan.vlc"
#endif

66
#define EDJPATH "edje"
67 68
#define ICONPATH "icon"
#define IMAGESPATH "images"
69
#define VIDEOPLAYEREDJ get_resource_path( EDJPATH "/video_player.edj")
70
#define AUDIOPLAYERMINIEDJ get_resource_path( EDJPATH "/audio_player_mini.edj")
71
#define BASICTEXTEDJ get_resource_path( EDJPATH "/basic_text.edj")
72

73 74
#define RES_DIR "/opt/usr/apps/" PACKAGE "/res/"
#define ICON_DIR RES_DIR "/images/"
75

76 77
#include <Evas.h>

78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
#define MAX_LENGTH_PATH 1024
static inline const char *get_resource_path(const char *file_path)
{
    static char absolute_path[MAX_LENGTH_PATH] = {'\0'};

    static char *res_path_buff = NULL;
    if(res_path_buff == NULL)
    {
        res_path_buff = app_get_resource_path();
    }

    snprintf(absolute_path, MAX_LENGTH_PATH, "%s%s", res_path_buff, file_path);

    return absolute_path;
}
Nicolas Pomepuy's avatar
Nicolas Pomepuy committed
93
#endif /* __vlc_common_H__ */