/**
 * Copyright 2012 Cabot Communications.  All rights reserved.
 *
 * @created Dec 28, 2012
 * 
 * @brief [TODO: Provide a brief description about the contents of this file]
 * 
 */


#ifndef ICE_STREAMER_EXTERNAL_STREAMER_H_
#define ICE_STREAMER_EXTERNAL_STREAMER_H_

#include "ice_streamer.h"
#include "frost_circular_buffer.h"

typedef struct ice_streamer_external_data_t
{
    CircularBuffer  * buffer;
    frost_uint        offset;  // Offset into stream
    frost_bool        done;

    ICE_MediaPlayerNeedDataCallback need_data_callback;
    frost_pointer     user_data;

    FROST_Mutex     * data_mutex;
    FROST_CondVar   * buffer_ready;
} ice_streamer_external_data_t;

frost_bool ice_streamer_external_streamer_init (ice_streamer_handler_t * handle);
void       ice_streamer_external_streamer_destroy (ice_streamer_handler_t * handle);
frost_int  ice_streamer_external_streamer_read (ice_streamer_handler_t *handle,
                                                void *buffer, frost_int len,
                                                ice_error_code_t *error);

#endif /* ICE_STREAMER_EXTERNAL_STREAMER_H_ */
