Skip to content

Commit

Permalink
write required lines based on comments in Pull Request
Browse files Browse the repository at this point in the history
  • Loading branch information
davutcavdar committed May 23, 2018
1 parent 62ff0a0 commit 1dc5685
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 45 deletions.
7 changes: 6 additions & 1 deletion changelog.txt
Expand Up @@ -4,10 +4,15 @@ Ant Media Server Changelog
This file contains informations about the changes between the different versions of Ant Media Server.


1.3.5
1.3.8
- Restream rtsp, rtmp, hls and ts stream URLs as Stream Source
- Improvement: Start StreamFetcher thread immediately after old one is finished to provide continuous stream
- Bug fix: New Stream Source form does not clear values after a stream source added
- Bug fix: In some streams, adaptive bitrate does not work properly. It creates longer video than expected and
this prevents web player to play properly
- Bug fix: Login request delay in management panel application





56 changes: 14 additions & 42 deletions src/main/java/io/antmedia/AntMediaApplicationAdapter.java
Expand Up @@ -53,7 +53,6 @@
public class AntMediaApplicationAdapter extends MultiThreadedApplicationAdapter implements IMuxerListener {

public static final String BEAN_NAME = "web.handler";

public static final String BROADCAST_STATUS_CREATED = "created";
public static final String BROADCAST_STATUS_BROADCASTING = "broadcasting";
public static final String BROADCAST_STATUS_FINISHED = "finished";
Expand All @@ -68,31 +67,14 @@ public class AntMediaApplicationAdapter extends MultiThreadedApplicationAdapter
public static final String FACEBOOK = "facebook";
public static final String PERISCOPE = "periscope";
public static final String YOUTUBE = "youtube";

public static final String FACEBOOK_ENDPOINT_CLASS = "io.antmedia.enterprise.social.endpoint.FacebookEndpoint";
public static final String YOUTUBE_ENDPOINT_CLASS = "io.antmedia.enterprise.social.endpoint.YoutubeEndpoint";



private List<VideoServiceEndpoint> videoServiceEndpoints = new ArrayList<>();
private List<VideoServiceEndpoint> videoServiceEndpointsHavingError = new ArrayList<>();

private List<IStreamPublishSecurity> streamPublishSecurityList;

private HashMap<String, OnvifCamera> onvifCameraList = new HashMap<String, OnvifCamera>();

private StreamFetcherManager streamFetcherManager;

private IDataStore dataStore;

public IDataStore getDataStore() {
return dataStore;
}

public void setDataStore(IDataStore dataStore) {
this.dataStore = dataStore;
}

private AppSettings appSettings;


Expand Down Expand Up @@ -139,13 +121,9 @@ else if (socialEndpointCredentials.getServiceName().equals(YOUTUBE))
if (appSettings != null) {
synchUserVoDFolder(null, appSettings.getVodFolder());
}

}


});


return super.appStart(app);
}

Expand Down Expand Up @@ -203,10 +181,6 @@ public void streamBroadcastClose(IBroadcastStream stream) {
super.streamBroadcastClose(stream);
}





public void closeBroadcast(String streamName) {

try {
Expand Down Expand Up @@ -260,11 +234,8 @@ public void execute(ISchedulingService service) throws CloneNotSupportedExceptio
} catch (Exception e) {
e.printStackTrace();
}


}


public void recreateEndpointsForSocialMedia(Broadcast broadcast, List<Endpoint> endPointList) {
for (Endpoint endpoint : endPointList) {

Expand Down Expand Up @@ -303,7 +274,6 @@ public VideoServiceEndpoint getEndpointService(String className,
return null;
}


@Override
public void streamPublishStart(final IBroadcastStream stream) {
String streamName = stream.getPublishedName();
Expand All @@ -329,10 +299,10 @@ public void execute(ISchedulingService service) throws CloneNotSupportedExceptio
broadcast = saveZombiBroadcast(streamName);

} else {

boolean result = dataStore.updateStatus(streamName, BROADCAST_STATUS_BROADCASTING);
logger.info(" Status of stream {} is set to Broadcasting with result: {}", broadcast.getStreamId(), result);

}

final String listenerHookURL = broadcast.getListenerHookURL();
Expand Down Expand Up @@ -428,15 +398,12 @@ public void muxingFinished(final String streamId, File file, long duration) {
else {
streamName = file.getName();
}


String[] subDirs = filePath.split(Pattern.quote(File.separator));

Integer pathLength=Integer.valueOf(subDirs.length);

String relativePath=subDirs[pathLength-3]+'/'+subDirs[pathLength-2]+'/'+subDirs[pathLength-1];


Vod newVod = new Vod(streamName, streamId, relativePath, name, unixTime, duration, fileSize, Vod.STREAM_VOD);

getDataStore().addVod(newVod);
Expand Down Expand Up @@ -626,7 +593,7 @@ public AppSettings getAppSettings() {
if(appSettings == null) {

AppSettings appSettings = new AppSettings();

appSettings.setMp4MuxingEnabled(true);
appSettings.setAddDateTimeToMp4FileName(true);
appSettings.setWebRTCEnabled(false);
Expand All @@ -641,7 +608,6 @@ public AppSettings getAppSettings() {
this.appSettings=appSettings;
}


return appSettings;
}

Expand All @@ -652,12 +618,12 @@ public void setAppSettings(AppSettings appSettings) {
public void sourceQualityChanged(String id,String quality)
{
addScheduledOnceJob(0, new IScheduledJob() {

@Override
public void execute(ISchedulingService service) throws CloneNotSupportedException {
boolean updateSourceQuality = getDataStore().updateSourceQuality(id, quality);
log.info("source stream {} quality changed, new quality is: {} , updating data strore {}", id, quality, updateSourceQuality);

}
});
}
Expand All @@ -670,12 +636,11 @@ public void sourceSpeedChanged(String id,double speed) {
@Override
public void execute(ISchedulingService service) throws CloneNotSupportedException {
getDataStore().updateSourceSpeed(id, speed);

}
});

}

}

public Result startStreaming(Broadcast broadcast) {

Expand Down Expand Up @@ -708,5 +673,12 @@ public OnvifCamera getOnvifCamera(String id) {
public StreamFetcherManager getStreamFetcherManager() {
return streamFetcherManager;
}
public IDataStore getDataStore() {
return dataStore;
}

public void setDataStore(IDataStore dataStore) {
this.dataStore = dataStore;
}

}
5 changes: 3 additions & 2 deletions src/main/java/io/antmedia/streamsource/StreamFetcher.java
Expand Up @@ -288,9 +288,9 @@ public void run() {
thread = new WorkerThread();
thread.start();
}

}

}
public void setStopRequestReceived() {
logger.warn("inside of setStopRequestReceived");
Expand All @@ -313,6 +313,7 @@ public void run() {
logger.info("waiting for thread to be finished for stream " + stream.getStreamUrl());
i = 0;
}
i++;
}
Thread.sleep(2000);
} catch (InterruptedException e) {
Expand Down

0 comments on commit 1dc5685

Please sign in to comment.