/*****************************************************************************
 *
 *   decoder.cpp
 *
 *   Included by "ctxh264_fb.cpp".
 *
 *   Copyright 2016 Citrix Systems, Inc.  All Rights Reserved.
 *
 *****************************************************************************/

#include "citrix.h"
#include "ctxh264.h"

int init_decoder()
{
    /* Perform one-time decoder initialization here.
     * Return 1 for success or 0 for failure.
     */
    
    return 1;
}

int deinit_decoder()
{
    /* Perform one-time decoder de-initialization here.
     * Return 1 for success or 0 for failure.
     */

    return 1;
}

int open_decoder_context(struct Decoder *dec, unsigned char *o_buf, int stride, int width, int height)
{
    /* Create and initialize decoder context here.
     * Return 1 for success or 0 for failure.
     */

    REFERENCE_VAR(dec);
    REFERENCE_VAR(o_buf);
    REFERENCE_VAR(stride);
    REFERENCE_VAR(width);
    REFERENCE_VAR(height);

    return 1;
}

int decode_frame(struct Decoder *dec, unsigned char *data, int length)
{
    /* Decode a full H.264 frame here.
     * Return 1 for success or 0 for failure.
     */

    REFERENCE_VAR(dec);
    REFERENCE_VAR(data);
    REFERENCE_VAR(length);

    return 1;
}

int yuv2rgb(struct Decoder *dec, unsigned char *o_buf, int stride, SIGNED_RECT bounds, int max_width, int max_height)
{
    /* Perform YUV to RGB conversion here.
     * Return 1 for success or 0 for failure.
     */

    REFERENCE_VAR(dec);
    REFERENCE_VAR(o_buf);
    REFERENCE_VAR(stride);
    REFERENCE_VAR(bounds);
    REFERENCE_VAR(max_width);
    REFERENCE_VAR(max_height);

    return 1;
}

int close_decoder_context(struct Decoder *dec)
{
    /* Destroy decoder context here.
     * Return 1 for success or 0 for failure.
     */

    REFERENCE_VAR(dec);

    return 1;
}
