001/*******************************************************************************
002 * Copyright (c) 2024, 2026, Olivier Ayache.  All rights reserved.
003 *
004 * This file is part of AVPKit.
005 *
006 * AVPKit is free software: you can redistribute it and/or modify
007 * it under the terms of the GNU Lesser General Public License as published by
008 * the Free Software Foundation, either version 3 of the License, or
009 * (at your option) any later version.
010 *
011 * AVPKit is distributed in the hope that it will be useful,
012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014 * GNU Lesser General Public License for more details.
015 *
016 * You should have received a copy of the GNU Lesser General Public License
017 * along with AVPKit.  If not, see <http://www.gnu.org/licenses/>.
018 *******************************************************************************/
019
020package com.avpkit.mediatool;
021
022import java.util.Collection;
023
024import com.avpkit.mediatool.event.IAddStreamEvent;
025import com.avpkit.mediatool.event.IAudioSamplesEvent;
026import com.avpkit.mediatool.event.ICloseCoderEvent;
027import com.avpkit.mediatool.event.ICloseEvent;
028import com.avpkit.mediatool.event.IFlushEvent;
029import com.avpkit.mediatool.event.IOpenCoderEvent;
030import com.avpkit.mediatool.event.IOpenEvent;
031import com.avpkit.mediatool.event.IReadPacketEvent;
032import com.avpkit.mediatool.event.IVideoPictureEvent;
033import com.avpkit.mediatool.event.IWriteHeaderEvent;
034import com.avpkit.mediatool.event.IWritePacketEvent;
035import com.avpkit.mediatool.event.IWriteTrailerEvent;
036/**
037 * An implementation of {@link IMediaTool} that
038 * forwards all {@link IMediaListener} events to
039 * listeners registered with {@link #addListener(IMediaListener)}.
040 * <p>
041 * Forwards every call on the {@link IMediaListener} interface methods to all 
042 * listeners added on the {@link IMediaGenerator} interface, and
043 * declares its support of the {@link IMediaTool} interface.
044 * </p>
045 * <p>
046 * This can be useful if you want to implement your own 
047 * {@link IMediaTool}, want help implementing the
048 * {@link IMediaListener} call backs, and want your parent
049 * class to declare support for the {@link IMediaTool} interface.
050 * </p>
051 * @author aclarke
052 *
053 */
054public class MediaToolAdapter  extends AMediaToolMixin
055implements IMediaTool
056{
057  /**
058   * Implementation note: We declare and forward
059   * to our parent every method in IMediaTool so that
060   * it shows up obviously in JavaDoc that these are the
061   * main methods people might override.
062   */
063
064  /**
065   * {@inheritDoc}
066   */
067  public boolean addListener(IMediaListener listener)
068  {
069    do {} while(false);
070    return super.addListener(listener);
071  }
072
073  /**
074   * {@inheritDoc}
075   */
076  public Collection<IMediaListener> getListeners()
077  {
078    do {} while(false);
079    return super.getListeners();
080  }
081
082  /**
083   * {@inheritDoc}
084   */
085  public boolean removeListener(IMediaListener listener)
086  {
087    do {} while(false);
088    return super.removeListener(listener);
089  }
090
091  /**
092   * {@inheritDoc}
093   */
094  public void onAddStream(IAddStreamEvent event)
095  {
096    do {} while(false);
097    super.onAddStream(event);
098  }
099
100  /**
101   * {@inheritDoc}
102   */
103  public void onAudioSamples(IAudioSamplesEvent event)
104  {
105    do {} while(false);
106    super.onAudioSamples(event);
107  }
108
109  /**
110   * {@inheritDoc}
111   */
112  public void onClose(ICloseEvent event)
113  {
114    do {} while(false);
115    super.onClose(event);
116  }
117
118  /**
119   * {@inheritDoc}
120   */
121  public void onCloseCoder(ICloseCoderEvent event)
122  {
123    do {} while(false);
124    super.onCloseCoder(event);
125  }
126
127  /**
128   * {@inheritDoc}
129   */
130  public void onFlush(IFlushEvent event)
131  {
132    do {} while(false);
133    super.onFlush(event);
134  }
135
136  /**
137   * {@inheritDoc}
138   */
139  public void onOpen(IOpenEvent event)
140  {
141    do {} while(false);
142    super.onOpen(event);
143  }
144
145  /**
146   * {@inheritDoc}
147   */
148  public void onOpenCoder(IOpenCoderEvent event)
149  {
150    do {} while(false);
151    super.onOpenCoder(event);
152  }
153
154  /**
155   * {@inheritDoc}
156   */
157  public void onReadPacket(IReadPacketEvent event)
158  {
159    do {} while(false);
160    super.onReadPacket(event); 
161  }
162
163  /**
164   * {@inheritDoc}
165   */
166  public void onVideoPicture(IVideoPictureEvent event)
167  {
168    do {} while(false);
169    super.onVideoPicture(event);
170  }
171
172  /**
173   * {@inheritDoc}
174   */
175  public void onWriteHeader(IWriteHeaderEvent event)
176  {
177    do {} while(false);
178    super.onWriteHeader(event);
179  }
180
181  /**
182   * {@inheritDoc}
183   */
184  public void onWritePacket(IWritePacketEvent event)
185  {
186    do {} while(false);
187    super.onWritePacket(event); 
188  }
189
190  /**
191   * {@inheritDoc}
192   */
193  public void onWriteTrailer(IWriteTrailerEvent event)
194  {
195    do {} while(false);
196    super.onWriteTrailer(event);
197  }
198
199}