modules/media/src/main/native/gstreamer/plugins/avcdecoder/avcdecoder.h

Print this page


   1 /*
   2  * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  49 struct _AvcDecoder
  50 {
  51     GstElement element;
  52 
  53     GstPad *sinkpad;        // input port for MPEG-4 audio
  54     GstPad *srcpad;         // output port for PCM samples
  55 
  56     VDADecoder decoder;     // the Video Decode Acceleration framework decoder reference
  57     VDADecoderOutputCallback* outputCallback; // the callback which receives decoded frames
  58 
  59     gboolean is_initialized; // whether this structure is initialized
  60     gboolean is_newsegment; // whether a new segment has been received
  61     volatile gboolean is_flushing; // element is between flush start and stop
  62     gboolean is_stride_set; // whether the output buffer stride has been set
  63 
  64     gint64 segment_start; // the start time of the segment
  65 
  66     GstClockTime frame_duration; // the duration of a single video frame (nsec)
  67 
  68     GQueue* ordered_frames;      // decoded frames sorted into order of increasign time stamp

  69 
  70     GstClockTime previous_timestamp; // the timestamp of the most recent preceding frame
  71     GstClockTime timestamp_ceil;     // increment above previous timestamp in which frame should fall
  72 };
  73 
  74 struct _AvcDecoderClass
  75 {
  76     GstElementClass parent_class;
  77 };
  78 
  79 GType avcdecoder_get_type (void);
  80 gboolean avcdecoder_plugin_init (GstPlugin * avcdecoder);
  81 
  82 G_END_DECLS
  83 
  84 #endif /* __AVCDECODER_H__ */
   1 /*
   2  * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  49 struct _AvcDecoder
  50 {
  51     GstElement element;
  52 
  53     GstPad *sinkpad;        // input port for MPEG-4 audio
  54     GstPad *srcpad;         // output port for PCM samples
  55 
  56     VDADecoder decoder;     // the Video Decode Acceleration framework decoder reference
  57     VDADecoderOutputCallback* outputCallback; // the callback which receives decoded frames
  58 
  59     gboolean is_initialized; // whether this structure is initialized
  60     gboolean is_newsegment; // whether a new segment has been received
  61     volatile gboolean is_flushing; // element is between flush start and stop
  62     gboolean is_stride_set; // whether the output buffer stride has been set
  63 
  64     gint64 segment_start; // the start time of the segment
  65 
  66     GstClockTime frame_duration; // the duration of a single video frame (nsec)
  67 
  68     GQueue* ordered_frames;      // decoded frames sorted into order of increasign time stamp
  69     GMutex* mutex;    // synchronize frames queue access
  70 
  71     GstClockTime previous_timestamp; // the timestamp of the most recent preceding frame
  72     GstClockTime timestamp_ceil;     // increment above previous timestamp in which frame should fall
  73 };
  74 
  75 struct _AvcDecoderClass
  76 {
  77     GstElementClass parent_class;
  78 };
  79 
  80 GType avcdecoder_get_type (void);
  81 gboolean avcdecoder_plugin_init (GstPlugin * avcdecoder);
  82 
  83 G_END_DECLS
  84 
  85 #endif /* __AVCDECODER_H__ */