/* Network-Integrated Multimedia Middleware (NMM)
 * http://www.motama.com/nmm.html
 *
 * Copyright (C) 2006-2007
 * Motama GmbH, Saarbruecken, Germany
 * http://www.motama.com
 *
 * This file is part of NMM. 
 * 
 * NMM 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; only version 2 of the License.      
 * 
 * NMM 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 NMM; if not, write to the Free Software Foundation,    
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 */

#ifndef NMM_IStillFrame_HPP
#define NMM_IStillFrame_HPP

#include "nmm/nmm_prefix.hpp"

#include "nmm/comm/Interface.hpp"
#include "nmm/comm/messaging/Event.hpp"
#include "nmm/comm/messaging/IllegalStateException.hpp"
#include <memory>


#include "visibility.hpp"

namespace NMM
{
  /**
   * Interface for still frame handling.
   * This interface provides instream events for indicating buffers that contain still frames.
   * A node sends two events to indicate that the last video frame contained in the buffers
   * between these two events is a stillframe.
   *
   * This looks a bit complicated but was necessary because the DVD reader indicates still frames
   * only after they have been read, and the output of the DVD reader is muxed data which contains
   * not only video data.
   * If a node can more easily detect a stillframe, it simply sends the two events before and
   * after sending the buffer that contains the still frame.
   */

  class DLLEXPORT IStillFrame : virtual public NMM::Interface { 
  public:
    IStillFrame() : NMM::Interface(IStillFrame::IStillFrame_type, "NMM") { };

    IStillFrame(NMM::NMMObject& parent) : NMM::Interface (parent, IStillFrame::IStillFrame_type, "NMM") { };

    virtual ~IStillFrame() {};

    static const char* IStillFrame_type;

    virtual  string getInterfaceType() const { return IStillFrame_type; }

    NMM::Interface* copy() const { return new IStillFrame(*this); }
    static void used(); 
    static const char* setStillFrame_event;
    static NMM::Event* create_setStillFrame(const nmm_bool& value);
  /* instream (protected) and non-instream (public) */        /**
     * Set still frame flag.
     * Instream event to set the still frame flag.
     * The still frame flag must be set to @a true before and to @a false after the data
     * which contains the still frame.
     * Nodes which respond to these events must internally keep track of the still frame flag.
     * @param value of the still frame flag
     */

    virtual Result setStillFrame(const nmm_bool& value) /* in-stream */ 
      throw(const NMM::SerializedException&);


  };

  typedef auto_ptr<IStillFrame> IStillFrame_var;




}

#include "nmm/nmm_suffix.hpp"

#endif
