JMF之API 初识...及JMF 2.0 api与JMF1.0 api的修改注意要点

本文详细介绍了JMF2.0 API的功能增强,包括新增类、接口及其设计目标,以及RTP支持的改进。重点讨论了JMF2.0在多媒体处理方面的增强特性,如媒体捕获、存储、播放控制、自定义处理等功能,并解释了如何通过插件API扩展JMF框架。同时,文章阐述了JMF2.0在RTP协议支持上的变化,包括新的类、接口和方法命名规则,以及如何利用插件体系结构支持自定义的RTP packetizers和depacketizers。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 (注:本贴只为方便自己快速温故所用,不是文章的全部翻译,只做部份摘要解译,方便自己快速浏览)

About JMF

               JMF1.0只供程序员把实时媒体加到应用中,而JMF2.0则增加了捕获设备多媒体、储存多媒体文件、和播放媒体时的控制功能组件、

               另外,JMF2.0还有plug-in 插件API ,它让高级的JMF开发员可以扩展这些jmf框架api

The JMF 1.0 API (the Java Media Player API) enabled programmers to
develop Java programs that presented time-based media. The JMF 2.0 API
extends the framework to provide support for capturing and storing
media data, controlling the type of processing that is performed during
playback, and performing custom processing on media data streams. In
addition, JMF 2.0 deÞnes a plug-in API that enables advanced developers
and technology providers to more easily customize and extend JMF functionality.

以下是JMF 2.0中新增类和接口:

AudioFormat                                  BitRateControl                                            Buffer

BufferControl                                 BufferToImage                                             BufferTransferHandler

CaptureDevice                              CaptureDeviceInfo                                       CaptureDeviceManager
CloneableDataSource                     Codec                                                           ConfigureCompleteEvent
ConnnectionErrorEvent               DataSink                                                     DataSinkErrorEvent
DataSinkEvent                            DataSinkListener                                        Demultiplexer

Effect                                          EndOfStreamEvent                                     FileTypeDescriptor
Format                                      FormatChangeEvent                                     FormatControl
FrameGrabbingControl               FramePositioningControl                                 FrameProcessingControl
FrameRateControl                     H261Control                                                    H261Format
H263Control                            H263Format                                                 ImageToBuffer
IndexedColorFormat                      InputSourceStream                                KeyFrameControl
MonitorControl                               MpegAudioControl                                   Multiplexer
NoStorageSpaceErrorEvent          PacketSizeControl                                    PlugIn
PlugInManager                             PortControl                                        Processor
ProcessorModel                        PullBufferDataSource                            PullBufferStream
PushBufferDataSource         PushBufferStream                                      QualityControl
Renderer                                 RGBFormat                                        SilenceSuppressionControl
StreamWriterControl                   Track                                                  TrackControl
VideoFormat                           VideoRenderer                                     YUVFormat

 

另外MediaPlayer 这个java bean 已经被加到 javax.media.bean.playerbean包中了。

MediaPlayer 可以被直接实例化对象,用它来展示一个或多个media streams。

(原文)In addition, the "MediaPlayer"  Java Bean has been included with the JMF
API in
javax.media.bean.playerbean.
MediaPlayer  can be instantiated  directly and used to present one or more media streams.

 

Design Goals for the JMF API 2.0

JMF API的设计目标:

          1、更容易编程

           2、支持媒体数据的捕获

           3、让多媒体技术和会议应用技术在java中成为可能

           4、让高级开发者与技术专家可以基于现有的api实现更加客户化的解决方案,以及更加方便集成一些新的技术特点到现有技术框架中。(扩展性)

          5、可以访问媒体原数据

          6、可以开发可以用客户化、可下载、复用、分路、编码、效果处理、与展示、插件等
JMF 2.0 supports media capture and addresses the needs of application
developers who want additional control over media processing and rendering.
It also provides a plug-in architecture that provides direct access
to media data and enables JMF to be more easily customized and
extended. JMF 2.0 is designed to:

¥ Be easy to program
¥ Support capturing media data
¥ Enable the development of media streaming and conferencing
applications in Java

¥ Enable advanced developers and technology providers to implement
custom solutions based on the existing API and easily integrate new
features with the existing framework
¥ Provide access to raw media data
¥ Enable the development of custom, downloadable demultiplexers,
codecs, effects processors, multiplexers, and renderers (JMF
plug-ins
)
¥ Maintain compatibility with JMF 1.0

 

About the JMF RTP APIs

 

在javax.media.rtp javax.media.rtp.event javax.media.rtp.rtcp三个包中包的类和接口就提供了对RTP的支持。

rtp的支持使得多媒体流可以在网络上传输。
The classes in
javax.media.rtp, javax.media.rtp.event
, and
javax.media.rtp.rtcp
provide support for RTP (Real-Time Transport Protocol).
RTP enables the transmission and reception of real-time media
streams across the network. RTP can be used for media-on-demand applications
as well as interactive services such as Internet telephony.

 

JMF 的实现不是必须包括RTP的支持

(原文)JMF-compliant implementations are not required to support the RTP
APIs in
javax.media.rtp
,
javax.media.rtp.event
, and
javax.media.rtp.rtcp
.

sun 和IBM提供了一些JMF api接口的参考实现

如:RTPSessionMgr等
The reference implementations of JMF provided
by Sun Microsystems, Inc. and IBM Corporation fully support these APIs.

第一个版本中只支持rtp streams的接收和播放,第二版api就增加了rtp streams 的发送。
(原文)The Þrst version of the JMF RTP APIs (referred to as the RTP Session Manager
API) enabled developers to receive RTP streams and play them using
JMF. In JMF 2.0, the RTP APIs also support the transmission of RTP
streams.

以下是RTP的类和接口在2.0中是新增的:

SendStream                                       SendStreamListener                      InactiveSendStreamEvent
ActiveSendStreamEvent                 SendPayloadChangeEvent                    NewSendStreamEvent
GlobalTransmissionStats                TransmissionStats 

RTP包中的一些类和接口已经被重新组织过了,一些方法也被重新命名过。

 The RTP packages have been reorganized and some classes, interfaces,
and methods have been renamed to make the API easier to use.

以下是包重新组织发生的改变

The package reorganization consists of the following changes:

1、The RTP event classes that were in javax.media.rtp.session are now in  javax.media.rtp.event


2、The RTCP-related classes that were in javax.media.rtp.session are now in javax.media.rtp.rtcp
.

3、The rest of the classes in javax.media.rtp.session are now in javax.media.rtp and the javax.media.rtp.session package has been removed.

以下是方法重新命名的规则

1、去了方法的rtp、rtcp前缀

The name changes consist primarily of the removal of the RTP and RTCP
preÞxes from class and interface names and the elimination of non-standard
abbreviations. For example,
RTPRecvStreamListener
has been
renamed to
ReceiveStreamListener
. For a complete list of the changes
made to the RTP packages, see the JMF 2.0 Beta release notes.

另外还会做一些修改以兼容jmf2.0对其它方面api的修改

 In addition, changes were made to the RTP APIs to make them compatible
with other changes in JMF 2.0:

 

1、javax.media.rtp.session.io 和javax.media.rtp.session.depacketizer 已经删除,客户化的rtp packetzers 和depacketizers现在通过JMF2.0的plug-in插件体系结构来提供支持。

     原来已存在的depacketizer会被放到现在的插件体系结构中去。
javax.media.rtp.session.io
and
javax.media.rtp.session.depacketizer
have been removed. Custom
RTP packetizers and depacketizers are now supported through the
JMF 2.0 plug-in architecture. Existing depacketizers will need to be
ported to the new plug-in architecture.
2、Buffer 对象实例是SessionManager传送的基本单元,代替来原来 的DePacketizedUnit 和DePacketizedObject传送单元。

     Buffer有自己的数据和头信息格式。
Buffer
is now the basic unit of transfer between the
SessionManager
and other JMF objects, in place of
DePacketizedUnit
and
DePacketizedObject.
RTP-formatted
Buffers
have a specific format
for their data and header objects.

3、 BaseEndcoingInfo已经被JMF的Format对像所代替了。一个rtp特定的Format通过一个特定的encoding字符串标志的。

       编码标志字符串都是“***_RTP格式的” 。如:RAW_RTP 。

        通过在Format中绑定一个动态加载数字来实现动态加载格式信息。

BaseEncodingInfo
has been replaced by the generic JMF
Format
object.
An RTP-specific
Format
is differentiated from other formats by its
encoding string. Encoding strings for RTP-specific
Formats
end in
_RTP
. Dynamic payload information can be provided by associating a
dynamic payload number with a
Format
object.

 

Design Goals for the JMF RTP APIs

// JMF RTP APIs的设计目标:为实现多媒体会议应用。


The RTP APIs in JMF 2.0 support the reception and transmission of RTP
streams and address the needs of application developers who want to use
RTP to implement media streaming and conferencing applications. These
APIs are designed to:
¥ Enable the development of media streaming and conferencing
applications in Java
¥ Support media data reception and transmission using RTP and RTCP
¥ Support custom packetizer and depacketizer plug-ins through the
JMF 2.0 plug-in architecture.
¥ Be easy to program

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值