From af21f8ae4a93c8b1127aefd3da5abe71c2393e20 Mon Sep 17 00:00:00 2001 From: Lyubomir Marinov <lyubomir.marinov@jitsi.org> Date: Wed, 3 Jul 2013 09:39:16 +0300 Subject: [PATCH] Templatizes AbstractBufferStream and extenders with respect to the type of its dataSource field. --- .../jmfext/media/protocol/AbstractBufferStream.java | 8 +++----- .../jmfext/media/protocol/AbstractPullBufferStream.java | 6 +++--- .../jmfext/media/protocol/AbstractPushBufferStream.java | 6 +++--- .../media/protocol/AbstractVideoPullBufferStream.java | 5 +++-- .../jmfext/media/protocol/directshow/DataSource.java | 2 +- .../media/protocol/directshow/DirectShowStream.java | 2 +- .../jmfext/media/protocol/imgstreaming/DataSource.java | 2 +- .../jmfext/media/protocol/imgstreaming/ImageStream.java | 2 +- .../jmfext/media/protocol/portaudio/DataSource.java | 2 +- .../jmfext/media/protocol/portaudio/PortAudioStream.java | 2 +- .../jmfext/media/protocol/pulseaudio/DataSource.java | 4 ++-- .../jmfext/media/protocol/quicktime/DataSource.java | 2 +- .../jmfext/media/protocol/quicktime/QuickTimeStream.java | 2 +- .../media/protocol/video4linux2/Video4Linux2Stream.java | 2 +- .../jmfext/media/protocol/wasapi/WASAPIStream.java | 2 +- .../impl/neomedia/protocol/FakePushBufferDataSource.java | 4 ++-- 16 files changed, 26 insertions(+), 27 deletions(-) diff --git a/src/org/jitsi/impl/neomedia/jmfext/media/protocol/AbstractBufferStream.java b/src/org/jitsi/impl/neomedia/jmfext/media/protocol/AbstractBufferStream.java index 5aa7dfe1..24cd087e 100644 --- a/src/org/jitsi/impl/neomedia/jmfext/media/protocol/AbstractBufferStream.java +++ b/src/org/jitsi/impl/neomedia/jmfext/media/protocol/AbstractBufferStream.java @@ -22,7 +22,7 @@ * * @author Lyubomir Marinov */ -abstract class AbstractBufferStream +abstract class AbstractBufferStream<T extends DataSource> extends AbstractControls implements SourceStream { @@ -44,7 +44,7 @@ abstract class AbstractBufferStream * The <tt>DataSource</tt> which has created this instance and which * contains it as one of its <tt>streams</tt>. */ - protected final DataSource dataSource; + protected final T dataSource; /** * The <tt>FormatControl</tt> which gives access to the <tt>Format</tt> of @@ -63,9 +63,7 @@ abstract class AbstractBufferStream * @param formatControl the <tt>FormatControl</tt> which is to abstract the * <tt>Format</tt>-related information of the new instance */ - protected AbstractBufferStream( - DataSource dataSource, - FormatControl formatControl) + protected AbstractBufferStream(T dataSource, FormatControl formatControl) { this.dataSource = dataSource; this.formatControl = formatControl; diff --git a/src/org/jitsi/impl/neomedia/jmfext/media/protocol/AbstractPullBufferStream.java b/src/org/jitsi/impl/neomedia/jmfext/media/protocol/AbstractPullBufferStream.java index 57d4dd3b..a5abed76 100644 --- a/src/org/jitsi/impl/neomedia/jmfext/media/protocol/AbstractPullBufferStream.java +++ b/src/org/jitsi/impl/neomedia/jmfext/media/protocol/AbstractPullBufferStream.java @@ -17,8 +17,8 @@ * * @author Lyubomir Marinov */ -public abstract class AbstractPullBufferStream - extends AbstractBufferStream +public abstract class AbstractPullBufferStream<T extends PullBufferDataSource> + extends AbstractBufferStream<T> implements PullBufferStream { @@ -33,7 +33,7 @@ public abstract class AbstractPullBufferStream * <tt>Format</tt>-related information of the new instance */ protected AbstractPullBufferStream( - PullBufferDataSource dataSource, + T dataSource, FormatControl formatControl) { super(dataSource, formatControl); diff --git a/src/org/jitsi/impl/neomedia/jmfext/media/protocol/AbstractPushBufferStream.java b/src/org/jitsi/impl/neomedia/jmfext/media/protocol/AbstractPushBufferStream.java index d612af3b..7017bf75 100644 --- a/src/org/jitsi/impl/neomedia/jmfext/media/protocol/AbstractPushBufferStream.java +++ b/src/org/jitsi/impl/neomedia/jmfext/media/protocol/AbstractPushBufferStream.java @@ -16,8 +16,8 @@ * * @author Lyubomir Marinov */ -public abstract class AbstractPushBufferStream - extends AbstractBufferStream +public abstract class AbstractPushBufferStream<T extends PushBufferDataSource> + extends AbstractBufferStream<T> implements PushBufferStream { @@ -38,7 +38,7 @@ public abstract class AbstractPushBufferStream * <tt>Format</tt>-related information of the new instance */ protected AbstractPushBufferStream( - PushBufferDataSource dataSource, + T dataSource, FormatControl formatControl) { super(dataSource, formatControl); diff --git a/src/org/jitsi/impl/neomedia/jmfext/media/protocol/AbstractVideoPullBufferStream.java b/src/org/jitsi/impl/neomedia/jmfext/media/protocol/AbstractVideoPullBufferStream.java index 81fc07ae..eb59afc9 100644 --- a/src/org/jitsi/impl/neomedia/jmfext/media/protocol/AbstractVideoPullBufferStream.java +++ b/src/org/jitsi/impl/neomedia/jmfext/media/protocol/AbstractVideoPullBufferStream.java @@ -20,7 +20,8 @@ * @author Lyubomir Marinov */ public abstract class AbstractVideoPullBufferStream - extends AbstractPullBufferStream + <T extends PullBufferDataSource> + extends AbstractPullBufferStream<T> { /** @@ -53,7 +54,7 @@ public abstract class AbstractVideoPullBufferStream * <tt>Format</tt>-related information of the new instance */ protected AbstractVideoPullBufferStream( - PullBufferDataSource dataSource, + T dataSource, FormatControl formatControl) { super(dataSource, formatControl); diff --git a/src/org/jitsi/impl/neomedia/jmfext/media/protocol/directshow/DataSource.java b/src/org/jitsi/impl/neomedia/jmfext/media/protocol/directshow/DataSource.java index 8856d64d..8a97a657 100644 --- a/src/org/jitsi/impl/neomedia/jmfext/media/protocol/directshow/DataSource.java +++ b/src/org/jitsi/impl/neomedia/jmfext/media/protocol/directshow/DataSource.java @@ -178,7 +178,7 @@ public float setFrameRate(float frameRate) * @see AbstractPushBufferCaptureDevice#createStream(int, FormatControl) */ @Override - protected AbstractPushBufferStream createStream( + protected DirectShowStream createStream( int streamIndex, FormatControl formatControl) { diff --git a/src/org/jitsi/impl/neomedia/jmfext/media/protocol/directshow/DirectShowStream.java b/src/org/jitsi/impl/neomedia/jmfext/media/protocol/directshow/DirectShowStream.java index 1bd07fb1..77c5143b 100644 --- a/src/org/jitsi/impl/neomedia/jmfext/media/protocol/directshow/DirectShowStream.java +++ b/src/org/jitsi/impl/neomedia/jmfext/media/protocol/directshow/DirectShowStream.java @@ -24,7 +24,7 @@ * @author Sebastien Vincent */ public class DirectShowStream - extends AbstractPushBufferStream + extends AbstractPushBufferStream<DataSource> { /** * The <tt>Logger</tt> used by the <tt>DirectShowStream</tt> class and its diff --git a/src/org/jitsi/impl/neomedia/jmfext/media/protocol/imgstreaming/DataSource.java b/src/org/jitsi/impl/neomedia/jmfext/media/protocol/imgstreaming/DataSource.java index 720d9fc8..e601c011 100644 --- a/src/org/jitsi/impl/neomedia/jmfext/media/protocol/imgstreaming/DataSource.java +++ b/src/org/jitsi/impl/neomedia/jmfext/media/protocol/imgstreaming/DataSource.java @@ -88,7 +88,7 @@ public DataSource(MediaLocator locator) * @see AbstractPullBufferCaptureDevice#createStream(int, FormatControl) */ @Override - protected AbstractPullBufferStream createStream( + protected ImageStream createStream( int streamIndex, FormatControl formatControl) { diff --git a/src/org/jitsi/impl/neomedia/jmfext/media/protocol/imgstreaming/ImageStream.java b/src/org/jitsi/impl/neomedia/jmfext/media/protocol/imgstreaming/ImageStream.java index 478ae848..9ce0a69d 100644 --- a/src/org/jitsi/impl/neomedia/jmfext/media/protocol/imgstreaming/ImageStream.java +++ b/src/org/jitsi/impl/neomedia/jmfext/media/protocol/imgstreaming/ImageStream.java @@ -28,7 +28,7 @@ * @author Damian Minkov */ public class ImageStream - extends AbstractVideoPullBufferStream + extends AbstractVideoPullBufferStream<DataSource> { /** * The <tt>Logger</tt> used by the <tt>ImageStream</tt> class and its diff --git a/src/org/jitsi/impl/neomedia/jmfext/media/protocol/portaudio/DataSource.java b/src/org/jitsi/impl/neomedia/jmfext/media/protocol/portaudio/DataSource.java index 51860b32..e598f13c 100644 --- a/src/org/jitsi/impl/neomedia/jmfext/media/protocol/portaudio/DataSource.java +++ b/src/org/jitsi/impl/neomedia/jmfext/media/protocol/portaudio/DataSource.java @@ -108,7 +108,7 @@ public DataSource( * @see AbstractPullBufferCaptureDevice#createStream(int, FormatControl) */ @Override - protected AbstractPullBufferStream createStream( + protected PortAudioStream createStream( int streamIndex, FormatControl formatControl) { diff --git a/src/org/jitsi/impl/neomedia/jmfext/media/protocol/portaudio/PortAudioStream.java b/src/org/jitsi/impl/neomedia/jmfext/media/protocol/portaudio/PortAudioStream.java index cfcbb3ba..5b7a149a 100644 --- a/src/org/jitsi/impl/neomedia/jmfext/media/protocol/portaudio/PortAudioStream.java +++ b/src/org/jitsi/impl/neomedia/jmfext/media/protocol/portaudio/PortAudioStream.java @@ -28,7 +28,7 @@ * @author Lyubomir Marinov */ public class PortAudioStream - extends AbstractPullBufferStream + extends AbstractPullBufferStream<DataSource> { /** * The <tt>Logger</tt> used by the <tt>PortAudioStream</tt> class and its diff --git a/src/org/jitsi/impl/neomedia/jmfext/media/protocol/pulseaudio/DataSource.java b/src/org/jitsi/impl/neomedia/jmfext/media/protocol/pulseaudio/DataSource.java index 5f3b9120..13b11bcc 100644 --- a/src/org/jitsi/impl/neomedia/jmfext/media/protocol/pulseaudio/DataSource.java +++ b/src/org/jitsi/impl/neomedia/jmfext/media/protocol/pulseaudio/DataSource.java @@ -82,7 +82,7 @@ public class DataSource * API/library. */ private class PulseAudioStream - extends AbstractPullBufferStream + extends AbstractPullBufferStream<DataSource> { private byte[] buffer; @@ -608,7 +608,7 @@ public DataSource() * {@inheritDoc} */ @Override - protected AbstractPullBufferStream createStream( + protected PulseAudioStream createStream( int streamIndex, FormatControl formatControl) { diff --git a/src/org/jitsi/impl/neomedia/jmfext/media/protocol/quicktime/DataSource.java b/src/org/jitsi/impl/neomedia/jmfext/media/protocol/quicktime/DataSource.java index 01ceb387..adbeac71 100644 --- a/src/org/jitsi/impl/neomedia/jmfext/media/protocol/quicktime/DataSource.java +++ b/src/org/jitsi/impl/neomedia/jmfext/media/protocol/quicktime/DataSource.java @@ -193,7 +193,7 @@ public float setFrameRate(float frameRate) * @see AbstractPushBufferCaptureDevice#createStream(int, FormatControl) */ @Override - protected AbstractPushBufferStream createStream( + protected QuickTimeStream createStream( int streamIndex, FormatControl formatControl) { diff --git a/src/org/jitsi/impl/neomedia/jmfext/media/protocol/quicktime/QuickTimeStream.java b/src/org/jitsi/impl/neomedia/jmfext/media/protocol/quicktime/QuickTimeStream.java index 44dc514f..9a26dd4f 100644 --- a/src/org/jitsi/impl/neomedia/jmfext/media/protocol/quicktime/QuickTimeStream.java +++ b/src/org/jitsi/impl/neomedia/jmfext/media/protocol/quicktime/QuickTimeStream.java @@ -26,7 +26,7 @@ * @author Lyubomir Marinov */ public class QuickTimeStream - extends AbstractPushBufferStream + extends AbstractPushBufferStream<DataSource> { /** diff --git a/src/org/jitsi/impl/neomedia/jmfext/media/protocol/video4linux2/Video4Linux2Stream.java b/src/org/jitsi/impl/neomedia/jmfext/media/protocol/video4linux2/Video4Linux2Stream.java index a9ec5eea..2894aaeb 100644 --- a/src/org/jitsi/impl/neomedia/jmfext/media/protocol/video4linux2/Video4Linux2Stream.java +++ b/src/org/jitsi/impl/neomedia/jmfext/media/protocol/video4linux2/Video4Linux2Stream.java @@ -25,7 +25,7 @@ * @author Lyubomir Marinov */ public class Video4Linux2Stream - extends AbstractVideoPullBufferStream + extends AbstractVideoPullBufferStream<DataSource> { /** * The <tt>AVCodecContext</tt> of the MJPEG decoder. diff --git a/src/org/jitsi/impl/neomedia/jmfext/media/protocol/wasapi/WASAPIStream.java b/src/org/jitsi/impl/neomedia/jmfext/media/protocol/wasapi/WASAPIStream.java index 3321155b..c60e837d 100644 --- a/src/org/jitsi/impl/neomedia/jmfext/media/protocol/wasapi/WASAPIStream.java +++ b/src/org/jitsi/impl/neomedia/jmfext/media/protocol/wasapi/WASAPIStream.java @@ -30,7 +30,7 @@ * @author Lyubomir Marinov */ public class WASAPIStream - extends AbstractPushBufferStream + extends AbstractPushBufferStream<DataSource> { /** * The default duration of the audio data in milliseconds to be read from diff --git a/src/org/jitsi/impl/neomedia/protocol/FakePushBufferDataSource.java b/src/org/jitsi/impl/neomedia/protocol/FakePushBufferDataSource.java index 62aa6ed3..54657e32 100644 --- a/src/org/jitsi/impl/neomedia/protocol/FakePushBufferDataSource.java +++ b/src/org/jitsi/impl/neomedia/protocol/FakePushBufferDataSource.java @@ -81,7 +81,7 @@ public void connect() * information abstracted by the specified <tt>formatControl</tt> */ @Override - protected AbstractPushBufferStream createStream( + protected FakePushBufferStream createStream( int streamIndex, FormatControl formatControl) { @@ -176,7 +176,7 @@ public void stop() * <tt>FakePushBufferDataSource</tt>. */ private static class FakePushBufferStream - extends AbstractPushBufferStream + extends AbstractPushBufferStream<FakePushBufferDataSource> { /** * Initializes a new <tt>FakePushBufferStream</tt> instance which is to -- GitLab