/*****************************************************************
 * gmerlin - a general purpose multimedia framework and applications
 *
 * Copyright (c) 2001 - 2012 Members of the Gmerlin project
 * gmerlin-general@lists.sourceforge.net
 * http://gmerlin.sourceforge.net
 *
 * 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, see <http://www.gnu.org/licenses/>.
 * *****************************************************************/

#include <config.h>
#include <gmerlin/parameter.h>
#include <gmerlin/cfg_registry.h>

#include <gmerlin/embedplayer.h>

#include <gmerlin/log.h>
#include <gmerlin/translation.h>

#include <gmerlin/bgsocket.h>
#include <gmerlin/http.h>
#include <gmerlin/httpserver.h>
#include <gmerlin/websocket.h>

#include <gmerlin/upnp/device.h>

#include "common.h"

typedef struct
  {
  bg_embed_player_t * p;
  bg_http_server_t * s;
  bg_upnp_device_t * dev;

  bg_controllable_t    * player_ctrl;
  
  bg_parameter_info_t * parameters;
  bg_websocket_context_t * ws;
  
  uuid_t uuid;
  char * uuid_str;
  char * upnp_name;

  int do_audio;
  int do_video;
  
  } renderer_t;

void renderer_init(renderer_t*);

int renderer_start(renderer_t*, const char *);

const bg_parameter_info_t * renderer_get_parameters(renderer_t * s);

void renderer_set_parameter(void * renderer, const char * name,
                            const gavl_value_t * val);

int renderer_get_parameter(void * renderer, const char * name,
                           gavl_value_t * val);

int renderer_iteration(renderer_t * s);
void renderer_cleanup(renderer_t * s);
